Skip to content

Commit

Permalink
Task/remove typiphy dependency (#24)
Browse files Browse the repository at this point in the history
* Remove need for cspray/typiphy

* update testing framework

* Improve AnnotatedTargetParserOptions into a value object

* Run check so we can make it required status

* Use newer version of composer install action
  • Loading branch information
cspray authored Aug 8, 2024
1 parent ec7204a commit f89cce7
Show file tree
Hide file tree
Showing 55 changed files with 290 additions and 479 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: 'Unit Tests'

on:
push:
branches: [ release-1.x, release-2.x ]
pull_request:
branches: [ release-1.x, release-2.x ]
on: push

jobs:
build-test:
Expand All @@ -24,7 +20,7 @@ jobs:
tools: none
coverage: none
- name: Composer Install
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.composer }}
- name: Unit Tests
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
vendor/
composer.lock
.phpunit.cache
.phpunit.result.cache
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
],
"require": {
"php": "^8.1",
"nikic/php-parser": "^v4.18 || ^5.0",
"cspray/typiphy": "^0.4"
"nikic/php-parser": "^v4.18 || ^5.0"
},
"require-dev": {
"pestphp/pest": "^v1.21"
"pestphp/pest": "^v2"
},
"autoload": {
"psr-4": {
Expand Down
7 changes: 2 additions & 5 deletions fixture_src/AliasedAttributeFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace Cspray\AnnotatedTargetFixture;

use Cspray\Typiphy\ObjectType;
use function Cspray\Typiphy\objectType;

final class AliasedAttributeFixture implements Fixture {

public function getPath() : string {
return __DIR__ . '/AliasedAttribute';
}

public function fooClass() : ObjectType {
return objectType(AliasedAttribute\FooClass::class);
public function fooClass() : string {
return AliasedAttribute\FooClass::class;
}
}
7 changes: 2 additions & 5 deletions fixture_src/ClassOnlyAttributeGroupSingleClassFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace Cspray\AnnotatedTargetFixture;

use Cspray\Typiphy\ObjectType;
use function Cspray\Typiphy\objectType;

class ClassOnlyAttributeGroupSingleClassFixture implements Fixture {

public function getPath() : string {
return __DIR__ . '/ClassOnlyAttributeGroupSingleClass';
}

public function fooClass() : ObjectType {
return objectType(ClassOnlyAttributeGroupSingleClass\FooClass::class);
public function fooClass() : string {
return ClassOnlyAttributeGroupSingleClass\FooClass::class;
}
}
4 changes: 2 additions & 2 deletions fixture_src/ClassOnlyAttributeSingleClassFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function getPath() : string {
return __DIR__ . '/ClassOnlyAttributeSingleClass';
}

public function fooClass() : ObjectType {
return objectType(ClassOnlyAttributeSingleClass\FooClass::class);
public function fooClass() : string {
return ClassOnlyAttributeSingleClass\FooClass::class;
}
}
4 changes: 2 additions & 2 deletions fixture_src/ClassOnlyAttributeSingleInterfaceFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function getPath() : string {
return __DIR__ .'/ClassOnlyAttributeSingleInterface';
}

public function fooInterface() : ObjectType {
return objectType(ClassOnlyAttributeSingleInterface\FooInterface::class);
public function fooInterface() : string {
return ClassOnlyAttributeSingleInterface\FooInterface::class;
}
}
4 changes: 2 additions & 2 deletions fixture_src/ConstantOnlyAttributeGroupSingleClassFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public function getPath() : string {
return __DIR__ . '/ConstantOnlyAttributeGroupSingleClass';
}

public function fooClass() : ObjectType {
return objectType(ConstantOnlyAttributeGroupSingleClass\FooClass::class);
public function fooClass() : string {
return ConstantOnlyAttributeGroupSingleClass\FooClass::class;
}

}
7 changes: 2 additions & 5 deletions fixture_src/MethodOnlyAttributeSingleClassFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace Cspray\AnnotatedTargetFixture;

use Cspray\Typiphy\ObjectType;
use function Cspray\Typiphy\objectType;

final class MethodOnlyAttributeSingleClassFixture implements Fixture {

public function getPath() : string {
return __DIR__ . '/MethodOnlyAttributeSingleClass';
}

public function fooClass() : ObjectType {
return objectType(MethodOnlyAttributeSingleClass\FooClass::class);
public function fooClass() : string {
return MethodOnlyAttributeSingleClass\FooClass::class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace Cspray\AnnotatedTargetFixture;

use Cspray\Typiphy\ObjectType;
use function Cspray\Typiphy\objectType;

final class MultipleDifferentClassOnlyAttributeSingleClassFixture implements Fixture {

public function getPath() : string {
return __DIR__ . '/MultipleDifferentClassOnlyAttributeSingleClass';
}

public function fooClass() : ObjectType {
return objectType(MultipleDifferentClassOnlyAttributeSingleClass\FooClass::class);
public function fooClass() : string {
return MultipleDifferentClassOnlyAttributeSingleClass\FooClass::class;
}
}
9 changes: 3 additions & 6 deletions fixture_src/NonPhpFileFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace Cspray\AnnotatedTargetFixture;

use Cspray\Typiphy\ObjectType;
use function Cspray\Typiphy\objectType;

class NonPhpFileFixture implements Fixture {

public function getPath() : string {
return __DIR__ . '/NonPhpFile';
}

public function fooClass() : ObjectType {
return objectType(NonPhpFile\FooClass::class);
public function fooClass() : string {
return NonPhpFile\FooClass::class;
}
}
}
7 changes: 2 additions & 5 deletions fixture_src/ParameterOnlyAttributeSingleClassFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace Cspray\AnnotatedTargetFixture;

use Cspray\Typiphy\ObjectType;
use function Cspray\Typiphy\objectType;

class ParameterOnlyAttributeSingleClassFixture implements Fixture {

public function getPath() : string {
return __DIR__ . '/ParameterOnlyAttributeSingleClass';
}

public function fooClass() : ObjectType {
return objectType(ParameterOnlyAttributeSingleClass\FooClass::class);
public function fooClass() : string {
return ParameterOnlyAttributeSingleClass\FooClass::class;
}
}
7 changes: 2 additions & 5 deletions fixture_src/PropertyOnlyAttributeSingleClassFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace Cspray\AnnotatedTargetFixture;

use Cspray\Typiphy\ObjectType;
use function Cspray\Typiphy\objectType;

final class PropertyOnlyAttributeSingleClassFixture implements Fixture {

public function getPath() : string {
return __DIR__ . '/PropertyOnlyAttributeSingleClass';
}

public function fooClass() : ObjectType {
return objectType(PropertyOnlyAttributeSingleClass\FooClass::class);
public function fooClass() : string {
return PropertyOnlyAttributeSingleClass\FooClass::class;
}
}
7 changes: 2 additions & 5 deletions fixture_src/RepeatableClassOnlyAttributeSingleFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace Cspray\AnnotatedTargetFixture;

use Cspray\Typiphy\ObjectType;
use function Cspray\Typiphy\objectType;

final class RepeatableClassOnlyAttributeSingleFixture implements Fixture {

public function getPath() : string {
return __DIR__ . '/RepeatableClassOnlyAttributeSingleClass';
}

public function fooClass() : ObjectType {
return objectType(RepeatableClassOnlyAttributeSingleClass\FooClass::class);
public function fooClass() : string {
return RepeatableClassOnlyAttributeSingleClass\FooClass::class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace Cspray\AnnotatedTargetFixture;

use Cspray\Typiphy\ObjectType;
use function Cspray\Typiphy\objectType;

class RepeatableConstantOnlyAttributeSingleClassFixture implements Fixture {

public function getPath() : string {
return __DIR__ . '/RepeatableConstantOnlyAttributeSingleClass';
}

public function fooClass() : ObjectType {
return objectType(RepeatableConstantOnlyAttributeSingleClass\FooClass::class);
public function fooClass() : string {
return RepeatableConstantOnlyAttributeSingleClass\FooClass::class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace Cspray\AnnotatedTargetFixture;

use Cspray\Typiphy\ObjectType;
use function Cspray\Typiphy\objectType;

class RepeatableMethodOnlyAttributeSingleClassFixture implements Fixture {

public function getPath() : string {
return __DIR__ .'/RepeatableMethodOnlyAttributeSingleClass';
}

public function fooClass() : ObjectType {
return objectType(RepeatableMethodOnlyAttributeSingleClass\FooClass::class);
public function fooClass() : string {
return RepeatableMethodOnlyAttributeSingleClass\FooClass::class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace Cspray\AnnotatedTargetFixture;

use Cspray\Typiphy\ObjectType;
use function Cspray\Typiphy\objectType;

final class RepeatableParameterOnlyAttributeSingleClassFixture implements Fixture {

public function getPath() : string {
return __DIR__ . '/RepeatableParameterOnlyAttributeSingleClass';
}

public function fooClass() : ObjectType {
return objectType(RepeatableParameterOnlyAttributeSingleClass\FooClass::class);
public function fooClass() : string {
return RepeatableParameterOnlyAttributeSingleClass\FooClass::class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace Cspray\AnnotatedTargetFixture;

use Cspray\Typiphy\ObjectType;
use function Cspray\Typiphy\objectType;

class RepeatablePropertyOnlyAttributeSingleClassFixture implements Fixture {

public function getPath() : string {
return __DIR__ . '/RepeatablePropertyOnlyAttributeSingleClass';
}

public function fooClass() : ObjectType {
return objectType(RepeatablePropertyOnlyAttributeSingleClass\FooClass::class);
public function fooClass() : string {
return RepeatablePropertyOnlyAttributeSingleClass\FooClass::class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

namespace Cspray\AnnotatedTargetFixture;

use Cspray\Typiphy\ObjectType;
use function Cspray\Typiphy\objectType;

class SingleAttributeMultipleConstantsSingleClassFixture implements Fixture {

public function getPath() : string {
return __DIR__ . '/SingleAttributeMultipleConstantsSingleClass';
}

public function fooClass() : ObjectType {
return objectType(SingleAttributeMultipleConstantsSingleClass\FooClass::class);
public function fooClass() : string {
return SingleAttributeMultipleConstantsSingleClass\FooClass::class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

namespace Cspray\AnnotatedTargetFixture;

use Cspray\Typiphy\ObjectType;
use function Cspray\Typiphy\objectType;

final class SingleAttributeMultiplePropertiesSingleClassFixture implements Fixture {

public function getPath() : string {
return __DIR__ . '/SingleAttributeMultiplePropertiesSingleClass';
}

public function fooClass() : ObjectType {
return objectType(SingleAttributeMultiplePropertiesSingleClass\FooClass::class);
public function fooClass() : string {
return SingleAttributeMultiplePropertiesSingleClass\FooClass::class;
}

}
6 changes: 2 additions & 4 deletions fixture_src/TargetAttributeInterfaceFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@
namespace Cspray\AnnotatedTargetFixture;

use Cspray\AnnotatedTargetFixture\TargetAttributeInterface\TargetClass;
use Cspray\Typiphy\ObjectType;
use function Cspray\Typiphy\objectType;

final class TargetAttributeInterfaceFixture implements Fixture {

public function getPath() : string {
return __DIR__ . '/TargetAttributeInterface';
}

public function targetClass() : ObjectType {
return objectType(TargetClass::class);
public function targetClass() : string {
return TargetClass::class;
}
}
Loading

0 comments on commit f89cce7

Please sign in to comment.