Skip to content

Commit

Permalink
Merge branch '4.1' of https://github.com/windwalker-io/framework into…
Browse files Browse the repository at this point in the history
… 4.1
  • Loading branch information
asika32764 committed Nov 9, 2023
2 parents a8fe86b + 75a5aad commit da7ae5a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
11 changes: 10 additions & 1 deletion packages/filesystem/src/Path.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ public static function isAbsolute(string $path): bool
return false;
}

if (str_contains($path, '://')) {
if (static::isURL($path)) {
return true;
}

Expand All @@ -455,6 +455,15 @@ public static function isAbsolute(string $path): bool
return false;
}

public static function isURL(string $path): bool
{
if ('' === $path) {
return false;
}

return str_contains($path, '://');
}

/**
* Returns whether a path is relative.
*
Expand Down
9 changes: 1 addition & 8 deletions packages/orm/src/EntityMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,7 @@
class EntityMapper implements EventAwareInterface
{
use EventAwareTrait;

public const UPDATE_NULLS = 1 << 0;

public const IGNORE_EVENTS = 1 << 1;

public const IGNORE_OLD_DATA = 1 << 2;

public const TRANSACTION = 1 << 3;
use EntityMapperConstantsTrait;

/**
* @var ORM
Expand Down
16 changes: 16 additions & 0 deletions packages/orm/src/EntityMapperConstantsTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

namespace Windwalker\ORM;

trait EntityMapperConstantsTrait
{
public const UPDATE_NULLS = 1 << 0;

public const IGNORE_EVENTS = 1 << 1;

public const IGNORE_OLD_DATA = 1 << 2;

public const TRANSACTION = 1 << 3;
}
2 changes: 1 addition & 1 deletion packages/orm/src/ORM.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
class ORM implements EventAwareInterface
{
use EventAwareTrait;

use AttributesAwareTrait;
use EntityMapperConstantsTrait;

protected ?FieldHydratorInterface $hydrator = null;

Expand Down

0 comments on commit da7ae5a

Please sign in to comment.