Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC: Require Path and Filename instances #39

Merged
merged 41 commits into from
Jan 20, 2024
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
91ce2e5
remove: Current group tests
joshbruce Jan 20, 2024
2f0f145
update: Dependencies
joshbruce Jan 20, 2024
c993800
BC: Require instance of Path
joshbruce Jan 20, 2024
105fa85
remove: Deprecated test
joshbruce Jan 20, 2024
a96dd46
BC: PublicDirectory requires Path
joshbruce Jan 20, 2024
334e5ac
BC: PrivateFile requires Path
joshbruce Jan 20, 2024
add08d1
BC: PrivateFile requires Filename
joshbruce Jan 20, 2024
7835ae1
BC: Mark PrivateFile constructor as final
joshbruce Jan 20, 2024
30b1c6c
refactor: String check no longer needed in PrivateDirectory
joshbruce Jan 20, 2024
ccdd99b
BC: Mark PricateDirectory constructor final
joshbruce Jan 20, 2024
db39d3d
refactor: PrivateFile
joshbruce Jan 20, 2024
b67868b
BC: PublicContentFile requires Path
joshbruce Jan 20, 2024
b1980d0
BC: PublicFile requires Path
joshbruce Jan 20, 2024
e9dd404
BC: PublicFile requires Filename
joshbruce Jan 20, 2024
867735c
BC: PublicJson requires Path
joshbruce Jan 20, 2024
31e335b
refactor: PublicContentFile to use Filename
joshbruce Jan 20, 2024
fe24971
BC: PublicMetaFile requires Path
joshbruce Jan 20, 2024
b9bb7c9
refactor: Use Path in SiteTest
joshbruce Jan 20, 2024
c0505db
refactor: PublicFile
joshbruce Jan 20, 2024
58db94f
refactor: PublicMetaFile
joshbruce Jan 20, 2024
3d2e038
refactor: PublicFile
joshbruce Jan 20, 2024
839bf1e
add: Filename to PrivateObject
joshbruce Jan 20, 2024
7b1492b
BC: PrivateObject requires Path
joshbruce Jan 20, 2024
342cee7
BC: PrivateObject requires PrivateObject
joshbruce Jan 20, 2024
d81167f
refactor: PrivateObject
joshbruce Jan 20, 2024
8452e33
add: toStringWithTrailingSlash to Path
joshbruce Jan 20, 2024
559ebdd
BC: PublicMeta requires Path
joshbruce Jan 20, 2024
474a83d
BC: Site methods require Path
joshbruce Jan 20, 2024
820cd25
BC: PublicObject requires Path
joshbruce Jan 20, 2024
50d0802
BC: PublicObject requires Filename
joshbruce Jan 20, 2024
6de57cf
BC: PrivateFile requires Path
joshbruce Jan 20, 2024
8afd11a
BC: PrivateFile requires Filename
joshbruce Jan 20, 2024
b1f4916
BC: PrivateJson requires Path
joshbruce Jan 20, 2024
811f329
BC: PrivateJson requires Filename
joshbruce Jan 20, 2024
21b7830
BC: PublicContent requires Path
joshbruce Jan 20, 2024
6cbfbd5
BC: PublicFile requires Path and Filename
joshbruce Jan 20, 2024
34cc79e
refactor: Includes
joshbruce Jan 20, 2024
9d9ada2
BC: PublicJson requires Filename
joshbruce Jan 20, 2024
e9fd0f1
BC: PublicMeta requires Path
joshbruce Jan 20, 2024
073044d
BC: Site publicFile requires Filename
joshbruce Jan 20, 2024
398a02a
remove: Comment
joshbruce Jan 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
BC: PublicMeta requires Path
  • Loading branch information
joshbruce committed Jan 20, 2024
commit 559ebdd943b4ffd6fb4bde971d08c775435884e4
9 changes: 2 additions & 7 deletions src/ObjectsFromJson/PublicMeta.php
Original file line number Diff line number Diff line change
@@ -17,13 +17,8 @@ final class PublicMeta implements Findable
{
private StdClass $object;

public static function inRoot(
Root $root,
string|Path $at = ''
): self {
if (is_string($at)) {
$at = Path::fromString($at);
}
public static function inRoot(Root $root, Path $at): self
{
return new self(
PlainTextPublicMeta::inRoot($root, $at)
);
11 changes: 8 additions & 3 deletions tests/ObjectsFromJson/PublicMetaTest.php
Original file line number Diff line number Diff line change
@@ -7,14 +7,19 @@

use Eightfold\Amos\ObjectsFromJson\PublicMeta;

use Eightfold\Amos\FileSystem\Path;

class PublicMetaTest extends BaseTestCase
{
/**
* @test
*/
public function can_get_content(): void
{
$sut = PublicMeta::inRoot(parent::root());
$sut = PublicMeta::inRoot(
parent::root(),
Path::fromString()
);

$expected = 'Root test content';

@@ -27,7 +32,7 @@ public function can_get_content(): void

$sut = PublicMeta::inRoot(
parent::root(),
DIRECTORY_SEPARATOR . 'l1-page'
Path::fromString('l1-page')
);

$expected = 1.0;
@@ -41,7 +46,7 @@ public function can_get_content(): void

$sut = PublicMeta::inRoot(
parent::root(),
DIRECTORY_SEPARATOR . 'l1-page'
Path::fromString('l1-page')
);

$result = $sut->nonexistent();
10 changes: 8 additions & 2 deletions tests/PlainText/PublicMetaTest.php
Original file line number Diff line number Diff line change
@@ -16,7 +16,10 @@ class PublicMetaTest extends BaseTestCase
*/
public function can_get_content_using_path(): void
{
$sut = PublicMeta::inRoot(parent::root());
$sut = PublicMeta::inRoot(
parent::root(),
Path::fromString()
);

$expected = <<<json
{
@@ -59,7 +62,10 @@ public function can_get_content_using_path(): void
*/
public function can_get_content(): void
{
$sut = PublicMeta::inRoot(parent::root());
$sut = PublicMeta::inRoot(
parent::root(),
Path::fromString()
);

$expected = <<<json
{