@@ -12,50 +12,50 @@ |
||
12 | 12 | */ |
13 | 13 | interface ModelObjectToJsonConverterInterface |
14 | 14 | { |
15 | - /** |
|
16 | - * @param array $entities |
|
17 | - * @return array |
|
18 | - * @since 5.0.0.p |
|
19 | - */ |
|
20 | - public function convertAndEncodeArrayOf(array $entities); |
|
21 | - |
|
22 | - |
|
23 | - /** |
|
24 | - * @param $entity |
|
25 | - * @return false|string |
|
26 | - * @since 5.0.0.p |
|
27 | - */ |
|
28 | - public function convertAndEncode($entity); |
|
29 | - |
|
30 | - |
|
31 | - /** |
|
32 | - * @param array $entities |
|
33 | - * @return array |
|
34 | - * @since 5.0.0.p |
|
35 | - */ |
|
36 | - public function convertArrayOf(array $entities); |
|
37 | - |
|
38 | - |
|
39 | - /** |
|
40 | - * @param $entity |
|
41 | - * @return array |
|
42 | - * @since 5.0.0.p |
|
43 | - */ |
|
44 | - public function convert($entity); |
|
45 | - |
|
46 | - |
|
47 | - /** |
|
48 | - * @param array $entities |
|
49 | - * @return array |
|
50 | - * @since 5.0.0.p |
|
51 | - */ |
|
52 | - public function encodeArrayOf(array $entities); |
|
53 | - |
|
54 | - |
|
55 | - /** |
|
56 | - * @param array $entity_array |
|
57 | - * @return false|string |
|
58 | - * @since 5.0.0.p |
|
59 | - */ |
|
60 | - public function encode(array $entity_array); |
|
15 | + /** |
|
16 | + * @param array $entities |
|
17 | + * @return array |
|
18 | + * @since 5.0.0.p |
|
19 | + */ |
|
20 | + public function convertAndEncodeArrayOf(array $entities); |
|
21 | + |
|
22 | + |
|
23 | + /** |
|
24 | + * @param $entity |
|
25 | + * @return false|string |
|
26 | + * @since 5.0.0.p |
|
27 | + */ |
|
28 | + public function convertAndEncode($entity); |
|
29 | + |
|
30 | + |
|
31 | + /** |
|
32 | + * @param array $entities |
|
33 | + * @return array |
|
34 | + * @since 5.0.0.p |
|
35 | + */ |
|
36 | + public function convertArrayOf(array $entities); |
|
37 | + |
|
38 | + |
|
39 | + /** |
|
40 | + * @param $entity |
|
41 | + * @return array |
|
42 | + * @since 5.0.0.p |
|
43 | + */ |
|
44 | + public function convert($entity); |
|
45 | + |
|
46 | + |
|
47 | + /** |
|
48 | + * @param array $entities |
|
49 | + * @return array |
|
50 | + * @since 5.0.0.p |
|
51 | + */ |
|
52 | + public function encodeArrayOf(array $entities); |
|
53 | + |
|
54 | + |
|
55 | + /** |
|
56 | + * @param array $entity_array |
|
57 | + * @return false|string |
|
58 | + * @since 5.0.0.p |
|
59 | + */ |
|
60 | + public function encode(array $entity_array); |
|
61 | 61 | } |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | interface DependencyHandlerInterface |
6 | 6 | { |
7 | - /** |
|
8 | - * @since 5.0.0.p |
|
9 | - */ |
|
10 | - public function registerDependencies(); |
|
7 | + /** |
|
8 | + * @since 5.0.0.p |
|
9 | + */ |
|
10 | + public function registerDependencies(); |
|
11 | 11 | } |
@@ -18,50 +18,50 @@ |
||
18 | 18 | */ |
19 | 19 | interface RouteInterface |
20 | 20 | { |
21 | - /** |
|
22 | - * @return JsonDataNode |
|
23 | - */ |
|
24 | - public function dataNode(): ?JsonDataNode; |
|
21 | + /** |
|
22 | + * @return JsonDataNode |
|
23 | + */ |
|
24 | + public function dataNode(): ?JsonDataNode; |
|
25 | 25 | |
26 | 26 | |
27 | - /** |
|
28 | - * final method called by RouteHandler on Route which in turn calls requestHandler() |
|
29 | - * |
|
30 | - * @return bool |
|
31 | - * @since 5.0.0.p |
|
32 | - */ |
|
33 | - public function handleRequest(): bool; |
|
27 | + /** |
|
28 | + * final method called by RouteHandler on Route which in turn calls requestHandler() |
|
29 | + * |
|
30 | + * @return bool |
|
31 | + * @since 5.0.0.p |
|
32 | + */ |
|
33 | + public function handleRequest(): bool; |
|
34 | 34 | |
35 | 35 | |
36 | - /** |
|
37 | - * a place to run any setup required for matchesCurrentRequest() which runs immediately after |
|
38 | - * |
|
39 | - * @since 5.0.0.p |
|
40 | - */ |
|
41 | - public function initialize(); |
|
36 | + /** |
|
37 | + * a place to run any setup required for matchesCurrentRequest() which runs immediately after |
|
38 | + * |
|
39 | + * @since 5.0.0.p |
|
40 | + */ |
|
41 | + public function initialize(); |
|
42 | 42 | |
43 | 43 | |
44 | - /** |
|
45 | - * returns true if the route has already been handled |
|
46 | - * |
|
47 | - * @return bool |
|
48 | - */ |
|
49 | - public function isHandled(): bool; |
|
44 | + /** |
|
45 | + * returns true if the route has already been handled |
|
46 | + * |
|
47 | + * @return bool |
|
48 | + */ |
|
49 | + public function isHandled(): bool; |
|
50 | 50 | |
51 | 51 | |
52 | - /** |
|
53 | - * returns true if the route has not yet been handled |
|
54 | - * |
|
55 | - * @return bool |
|
56 | - */ |
|
57 | - public function isNotHandled(): bool; |
|
52 | + /** |
|
53 | + * returns true if the route has not yet been handled |
|
54 | + * |
|
55 | + * @return bool |
|
56 | + */ |
|
57 | + public function isNotHandled(): bool; |
|
58 | 58 | |
59 | 59 | |
60 | - /** |
|
61 | - * returns true if the current request matches this route |
|
62 | - * |
|
63 | - * @return bool |
|
64 | - * @since 5.0.0.p |
|
65 | - */ |
|
66 | - public function matchesCurrentRequest(): bool; |
|
60 | + /** |
|
61 | + * returns true if the current request matches this route |
|
62 | + * |
|
63 | + * @return bool |
|
64 | + * @since 5.0.0.p |
|
65 | + */ |
|
66 | + public function matchesCurrentRequest(): bool; |
|
67 | 67 | } |
@@ -17,65 +17,65 @@ |
||
17 | 17 | */ |
18 | 18 | class InputsManager implements GQLManagerInterface |
19 | 19 | { |
20 | - /** |
|
21 | - * @var InputCollection|InputInterface[] $inputs |
|
22 | - */ |
|
23 | - private $inputs; |
|
20 | + /** |
|
21 | + * @var InputCollection|InputInterface[] $inputs |
|
22 | + */ |
|
23 | + private $inputs; |
|
24 | 24 | |
25 | 25 | |
26 | - /** |
|
27 | - * InputsManager constructor. |
|
28 | - * |
|
29 | - * @param InputCollection|InputInterface[] $inputs |
|
30 | - */ |
|
31 | - public function __construct(InputCollection $inputs) |
|
32 | - { |
|
33 | - $this->inputs = $inputs; |
|
34 | - } |
|
26 | + /** |
|
27 | + * InputsManager constructor. |
|
28 | + * |
|
29 | + * @param InputCollection|InputInterface[] $inputs |
|
30 | + */ |
|
31 | + public function __construct(InputCollection $inputs) |
|
32 | + { |
|
33 | + $this->inputs = $inputs; |
|
34 | + } |
|
35 | 35 | |
36 | 36 | |
37 | - /** |
|
38 | - * @throws CollectionDetailsException |
|
39 | - * @throws CollectionLoaderException |
|
40 | - * @since 5.0.0.p |
|
41 | - */ |
|
42 | - public function init() |
|
43 | - { |
|
44 | - $this->inputs->loadInputs(); |
|
45 | - add_action('graphql_register_types', [$this, 'configureInputs'], 9); |
|
46 | - } |
|
37 | + /** |
|
38 | + * @throws CollectionDetailsException |
|
39 | + * @throws CollectionLoaderException |
|
40 | + * @since 5.0.0.p |
|
41 | + */ |
|
42 | + public function init() |
|
43 | + { |
|
44 | + $this->inputs->loadInputs(); |
|
45 | + add_action('graphql_register_types', [$this, 'configureInputs'], 9); |
|
46 | + } |
|
47 | 47 | |
48 | 48 | |
49 | - /** |
|
50 | - * @since 5.0.0.p |
|
51 | - */ |
|
52 | - public function configureInputs() |
|
53 | - { |
|
54 | - // loop through the collection of inputs and register their fields |
|
55 | - foreach ($this->inputs as $input) { |
|
56 | - $this->registerInput($input); |
|
57 | - } |
|
58 | - } |
|
49 | + /** |
|
50 | + * @since 5.0.0.p |
|
51 | + */ |
|
52 | + public function configureInputs() |
|
53 | + { |
|
54 | + // loop through the collection of inputs and register their fields |
|
55 | + foreach ($this->inputs as $input) { |
|
56 | + $this->registerInput($input); |
|
57 | + } |
|
58 | + } |
|
59 | 59 | |
60 | 60 | |
61 | - /** |
|
62 | - * @param InputInterface $input |
|
63 | - * @since 5.0.0.p |
|
64 | - */ |
|
65 | - public function registerInput(InputInterface $input) |
|
66 | - { |
|
67 | - $inputFields = []; |
|
68 | - foreach ($input->fields() as $field) { |
|
69 | - $fieldName = $field->name(); |
|
70 | - $inputFields[ $fieldName ] = $field->toArray(); |
|
71 | - } |
|
72 | - // Register the input type. |
|
73 | - register_graphql_input_type( |
|
74 | - $input->name(), |
|
75 | - [ |
|
76 | - 'description' => $input->description(), |
|
77 | - 'fields' => $inputFields, |
|
78 | - ] |
|
79 | - ); |
|
80 | - } |
|
61 | + /** |
|
62 | + * @param InputInterface $input |
|
63 | + * @since 5.0.0.p |
|
64 | + */ |
|
65 | + public function registerInput(InputInterface $input) |
|
66 | + { |
|
67 | + $inputFields = []; |
|
68 | + foreach ($input->fields() as $field) { |
|
69 | + $fieldName = $field->name(); |
|
70 | + $inputFields[ $fieldName ] = $field->toArray(); |
|
71 | + } |
|
72 | + // Register the input type. |
|
73 | + register_graphql_input_type( |
|
74 | + $input->name(), |
|
75 | + [ |
|
76 | + 'description' => $input->description(), |
|
77 | + 'fields' => $inputFields, |
|
78 | + ] |
|
79 | + ); |
|
80 | + } |
|
81 | 81 | } |
@@ -15,13 +15,13 @@ |
||
15 | 15 | */ |
16 | 16 | interface ResolverInterface |
17 | 17 | { |
18 | - /** |
|
19 | - * @param $source |
|
20 | - * @param array $args |
|
21 | - * @param AppContext $context |
|
22 | - * @param ResolveInfo $info |
|
23 | - * @return mixed |
|
24 | - * @since 5.0.0.p |
|
25 | - */ |
|
26 | - public function resolve($source, array $args, AppContext $context, ResolveInfo $info); |
|
18 | + /** |
|
19 | + * @param $source |
|
20 | + * @param array $args |
|
21 | + * @param AppContext $context |
|
22 | + * @param ResolveInfo $info |
|
23 | + * @return mixed |
|
24 | + * @since 5.0.0.p |
|
25 | + */ |
|
26 | + public function resolve($source, array $args, AppContext $context, ResolveInfo $info); |
|
27 | 27 | } |
@@ -20,86 +20,86 @@ |
||
20 | 20 | */ |
21 | 21 | class ResolverCollection extends Collection |
22 | 22 | { |
23 | - const COLLECTION_NAME = 'espresso_graphql_resolvers'; |
|
23 | + const COLLECTION_NAME = 'espresso_graphql_resolvers'; |
|
24 | 24 | |
25 | - /** |
|
26 | - * @var CollectionLoader $loader |
|
27 | - */ |
|
28 | - protected $loader; |
|
25 | + /** |
|
26 | + * @var CollectionLoader $loader |
|
27 | + */ |
|
28 | + protected $loader; |
|
29 | 29 | |
30 | - /** |
|
31 | - * ResolverCollection constructor |
|
32 | - * |
|
33 | - * @throws InvalidInterfaceException |
|
34 | - */ |
|
35 | - public function __construct() |
|
36 | - { |
|
37 | - parent::__construct( |
|
38 | - 'EventEspresso\core\services\graphql\ResolverInterface', |
|
39 | - ResolverCollection::COLLECTION_NAME |
|
40 | - ); |
|
41 | - } |
|
30 | + /** |
|
31 | + * ResolverCollection constructor |
|
32 | + * |
|
33 | + * @throws InvalidInterfaceException |
|
34 | + */ |
|
35 | + public function __construct() |
|
36 | + { |
|
37 | + parent::__construct( |
|
38 | + 'EventEspresso\core\services\graphql\ResolverInterface', |
|
39 | + ResolverCollection::COLLECTION_NAME |
|
40 | + ); |
|
41 | + } |
|
42 | 42 | |
43 | 43 | |
44 | - /** |
|
45 | - * @throws CollectionDetailsException |
|
46 | - * @throws CollectionLoaderException |
|
47 | - * @since 5.0.0.p |
|
48 | - */ |
|
49 | - private function loadCollection() |
|
50 | - { |
|
51 | - if (! $this->loader instanceof CollectionLoader) { |
|
52 | - $this->loader = new CollectionLoader( |
|
53 | - new CollectionDetails( |
|
54 | - // collection name |
|
55 | - ResolverCollection::COLLECTION_NAME, |
|
56 | - // collection interface |
|
57 | - 'EventEspresso\core\services\graphql\ResolverInterface', |
|
58 | - // FQCNs for classes to add (all classes within each namespace will be loaded) |
|
59 | - apply_filters( |
|
60 | - 'FHEE__EventEspresso_core_services_graphql_ResolverCollection__loadCollection__collection_FQCNs', |
|
61 | - ['EventEspresso\core\domain\services\graphql\resolvers'] |
|
62 | - ), |
|
63 | - // filepaths to classes to add |
|
64 | - array(), |
|
65 | - // file mask to use if parsing folder for files to add |
|
66 | - '', |
|
67 | - // what to use as identifier for collection entities |
|
68 | - // using CLASS NAME prevents duplicates (works like a singleton) |
|
69 | - CollectionDetails::ID_CLASS_NAME |
|
70 | - ), |
|
71 | - $this |
|
72 | - ); |
|
73 | - } |
|
74 | - } |
|
44 | + /** |
|
45 | + * @throws CollectionDetailsException |
|
46 | + * @throws CollectionLoaderException |
|
47 | + * @since 5.0.0.p |
|
48 | + */ |
|
49 | + private function loadCollection() |
|
50 | + { |
|
51 | + if (! $this->loader instanceof CollectionLoader) { |
|
52 | + $this->loader = new CollectionLoader( |
|
53 | + new CollectionDetails( |
|
54 | + // collection name |
|
55 | + ResolverCollection::COLLECTION_NAME, |
|
56 | + // collection interface |
|
57 | + 'EventEspresso\core\services\graphql\ResolverInterface', |
|
58 | + // FQCNs for classes to add (all classes within each namespace will be loaded) |
|
59 | + apply_filters( |
|
60 | + 'FHEE__EventEspresso_core_services_graphql_ResolverCollection__loadCollection__collection_FQCNs', |
|
61 | + ['EventEspresso\core\domain\services\graphql\resolvers'] |
|
62 | + ), |
|
63 | + // filepaths to classes to add |
|
64 | + array(), |
|
65 | + // file mask to use if parsing folder for files to add |
|
66 | + '', |
|
67 | + // what to use as identifier for collection entities |
|
68 | + // using CLASS NAME prevents duplicates (works like a singleton) |
|
69 | + CollectionDetails::ID_CLASS_NAME |
|
70 | + ), |
|
71 | + $this |
|
72 | + ); |
|
73 | + } |
|
74 | + } |
|
75 | 75 | |
76 | 76 | |
77 | - /** |
|
78 | - * @return CollectionInterface |
|
79 | - * @throws CollectionDetailsException |
|
80 | - * @throws CollectionLoaderException |
|
81 | - * @since 5.0.0.p |
|
82 | - */ |
|
83 | - public function loadResolvers() |
|
84 | - { |
|
85 | - $this->loadCollection(); |
|
86 | - return $this->loader->getCollection(); |
|
87 | - } |
|
77 | + /** |
|
78 | + * @return CollectionInterface |
|
79 | + * @throws CollectionDetailsException |
|
80 | + * @throws CollectionLoaderException |
|
81 | + * @since 5.0.0.p |
|
82 | + */ |
|
83 | + public function loadResolvers() |
|
84 | + { |
|
85 | + $this->loadCollection(); |
|
86 | + return $this->loader->getCollection(); |
|
87 | + } |
|
88 | 88 | |
89 | 89 | |
90 | - /** |
|
91 | - * getIdentifier |
|
92 | - * Overrides EventEspresso\core\services\collections\Collection::getIdentifier() |
|
93 | - * If no $identifier is supplied, then the fully qualified class name is used |
|
94 | - * |
|
95 | - * @param $object |
|
96 | - * @param mixed $identifier |
|
97 | - * @return bool |
|
98 | - */ |
|
99 | - public function getIdentifier($object, $identifier = null) |
|
100 | - { |
|
101 | - return ! empty($identifier) |
|
102 | - ? $identifier |
|
103 | - : get_class($object); |
|
104 | - } |
|
90 | + /** |
|
91 | + * getIdentifier |
|
92 | + * Overrides EventEspresso\core\services\collections\Collection::getIdentifier() |
|
93 | + * If no $identifier is supplied, then the fully qualified class name is used |
|
94 | + * |
|
95 | + * @param $object |
|
96 | + * @param mixed $identifier |
|
97 | + * @return bool |
|
98 | + */ |
|
99 | + public function getIdentifier($object, $identifier = null) |
|
100 | + { |
|
101 | + return ! empty($identifier) |
|
102 | + ? $identifier |
|
103 | + : get_class($object); |
|
104 | + } |
|
105 | 105 | } |
@@ -15,10 +15,10 @@ |
||
15 | 15 | */ |
16 | 16 | interface GQLManagerInterface |
17 | 17 | { |
18 | - /** |
|
19 | - * @throws CollectionDetailsException |
|
20 | - * @throws CollectionLoaderException |
|
21 | - * @since 5.0.0.p |
|
22 | - */ |
|
23 | - public function init(); |
|
18 | + /** |
|
19 | + * @throws CollectionDetailsException |
|
20 | + * @throws CollectionLoaderException |
|
21 | + * @since 5.0.0.p |
|
22 | + */ |
|
23 | + public function init(); |
|
24 | 24 | } |
@@ -17,60 +17,60 @@ |
||
17 | 17 | */ |
18 | 18 | class EnumsManager implements GQLManagerInterface |
19 | 19 | { |
20 | - /** |
|
21 | - * @var EnumCollection|EnumInterface[] $enums |
|
22 | - */ |
|
23 | - private $enums; |
|
20 | + /** |
|
21 | + * @var EnumCollection|EnumInterface[] $enums |
|
22 | + */ |
|
23 | + private $enums; |
|
24 | 24 | |
25 | 25 | |
26 | - /** |
|
27 | - * EnumsManager constructor. |
|
28 | - * |
|
29 | - * @param EnumCollection|EnumInterface[] $enums |
|
30 | - */ |
|
31 | - public function __construct(EnumCollection $enums) |
|
32 | - { |
|
33 | - $this->enums = $enums; |
|
34 | - } |
|
26 | + /** |
|
27 | + * EnumsManager constructor. |
|
28 | + * |
|
29 | + * @param EnumCollection|EnumInterface[] $enums |
|
30 | + */ |
|
31 | + public function __construct(EnumCollection $enums) |
|
32 | + { |
|
33 | + $this->enums = $enums; |
|
34 | + } |
|
35 | 35 | |
36 | 36 | |
37 | - /** |
|
38 | - * @throws CollectionDetailsException |
|
39 | - * @throws CollectionLoaderException |
|
40 | - * @since 5.0.0.p |
|
41 | - */ |
|
42 | - public function init() |
|
43 | - { |
|
44 | - $this->enums->loadEnums(); |
|
45 | - add_action('graphql_register_types', [$this, 'configureEnums'], 8); |
|
46 | - } |
|
37 | + /** |
|
38 | + * @throws CollectionDetailsException |
|
39 | + * @throws CollectionLoaderException |
|
40 | + * @since 5.0.0.p |
|
41 | + */ |
|
42 | + public function init() |
|
43 | + { |
|
44 | + $this->enums->loadEnums(); |
|
45 | + add_action('graphql_register_types', [$this, 'configureEnums'], 8); |
|
46 | + } |
|
47 | 47 | |
48 | 48 | |
49 | - /** |
|
50 | - * @since 5.0.0.p |
|
51 | - */ |
|
52 | - public function configureEnums() |
|
53 | - { |
|
54 | - // loop through the collection of enums and register their fields |
|
55 | - foreach ($this->enums as $enum) { |
|
56 | - $this->registerEnum($enum); |
|
57 | - } |
|
58 | - } |
|
49 | + /** |
|
50 | + * @since 5.0.0.p |
|
51 | + */ |
|
52 | + public function configureEnums() |
|
53 | + { |
|
54 | + // loop through the collection of enums and register their fields |
|
55 | + foreach ($this->enums as $enum) { |
|
56 | + $this->registerEnum($enum); |
|
57 | + } |
|
58 | + } |
|
59 | 59 | |
60 | 60 | |
61 | - /** |
|
62 | - * @param EnumInterface $enum |
|
63 | - * @since 5.0.0.p |
|
64 | - */ |
|
65 | - public function registerEnum(EnumInterface $enum) |
|
66 | - { |
|
67 | - // Register the enum type. |
|
68 | - register_graphql_enum_type( |
|
69 | - $enum->name(), |
|
70 | - [ |
|
71 | - 'description' => $enum->description(), |
|
72 | - 'values' => $enum->values(), |
|
73 | - ] |
|
74 | - ); |
|
75 | - } |
|
61 | + /** |
|
62 | + * @param EnumInterface $enum |
|
63 | + * @since 5.0.0.p |
|
64 | + */ |
|
65 | + public function registerEnum(EnumInterface $enum) |
|
66 | + { |
|
67 | + // Register the enum type. |
|
68 | + register_graphql_enum_type( |
|
69 | + $enum->name(), |
|
70 | + [ |
|
71 | + 'description' => $enum->description(), |
|
72 | + 'values' => $enum->values(), |
|
73 | + ] |
|
74 | + ); |
|
75 | + } |
|
76 | 76 | } |
@@ -20,86 +20,86 @@ |
||
20 | 20 | */ |
21 | 21 | class InputCollection extends Collection |
22 | 22 | { |
23 | - const COLLECTION_NAME = 'espresso_graphql_inputs'; |
|
23 | + const COLLECTION_NAME = 'espresso_graphql_inputs'; |
|
24 | 24 | |
25 | - /** |
|
26 | - * @var CollectionLoader $loader |
|
27 | - */ |
|
28 | - protected $loader; |
|
25 | + /** |
|
26 | + * @var CollectionLoader $loader |
|
27 | + */ |
|
28 | + protected $loader; |
|
29 | 29 | |
30 | - /** |
|
31 | - * InputCollection constructor |
|
32 | - * |
|
33 | - * @throws InvalidInterfaceException |
|
34 | - */ |
|
35 | - public function __construct() |
|
36 | - { |
|
37 | - parent::__construct( |
|
38 | - 'EventEspresso\core\services\graphql\inputs\InputInterface', |
|
39 | - InputCollection::COLLECTION_NAME |
|
40 | - ); |
|
41 | - } |
|
30 | + /** |
|
31 | + * InputCollection constructor |
|
32 | + * |
|
33 | + * @throws InvalidInterfaceException |
|
34 | + */ |
|
35 | + public function __construct() |
|
36 | + { |
|
37 | + parent::__construct( |
|
38 | + 'EventEspresso\core\services\graphql\inputs\InputInterface', |
|
39 | + InputCollection::COLLECTION_NAME |
|
40 | + ); |
|
41 | + } |
|
42 | 42 | |
43 | 43 | |
44 | - /** |
|
45 | - * @throws CollectionDetailsException |
|
46 | - * @throws CollectionLoaderException |
|
47 | - * @since 5.0.0.p |
|
48 | - */ |
|
49 | - private function loadCollection() |
|
50 | - { |
|
51 | - if (! $this->loader instanceof CollectionLoader) { |
|
52 | - $this->loader = new CollectionLoader( |
|
53 | - new CollectionDetails( |
|
54 | - // collection name |
|
55 | - InputCollection::COLLECTION_NAME, |
|
56 | - // collection interface |
|
57 | - 'EventEspresso\core\services\graphql\inputs\InputInterface', |
|
58 | - // FQCNs for classes to add (all classes within each namespace will be loaded) |
|
59 | - apply_filters( |
|
60 | - 'FHEE__EventEspresso_core_services_graphql_InputCollection__loadCollection__collection_FQCNs', |
|
61 | - ['EventEspresso\core\domain\services\graphql\inputs'] |
|
62 | - ), |
|
63 | - // filepaths to classes to add |
|
64 | - array(), |
|
65 | - // file mask to use if parsing folder for files to add |
|
66 | - '', |
|
67 | - // what to use as identifier for collection entities |
|
68 | - // using CLASS NAME prevents duplicates (works like a singleton) |
|
69 | - CollectionDetails::ID_CLASS_NAME |
|
70 | - ), |
|
71 | - $this |
|
72 | - ); |
|
73 | - } |
|
74 | - } |
|
44 | + /** |
|
45 | + * @throws CollectionDetailsException |
|
46 | + * @throws CollectionLoaderException |
|
47 | + * @since 5.0.0.p |
|
48 | + */ |
|
49 | + private function loadCollection() |
|
50 | + { |
|
51 | + if (! $this->loader instanceof CollectionLoader) { |
|
52 | + $this->loader = new CollectionLoader( |
|
53 | + new CollectionDetails( |
|
54 | + // collection name |
|
55 | + InputCollection::COLLECTION_NAME, |
|
56 | + // collection interface |
|
57 | + 'EventEspresso\core\services\graphql\inputs\InputInterface', |
|
58 | + // FQCNs for classes to add (all classes within each namespace will be loaded) |
|
59 | + apply_filters( |
|
60 | + 'FHEE__EventEspresso_core_services_graphql_InputCollection__loadCollection__collection_FQCNs', |
|
61 | + ['EventEspresso\core\domain\services\graphql\inputs'] |
|
62 | + ), |
|
63 | + // filepaths to classes to add |
|
64 | + array(), |
|
65 | + // file mask to use if parsing folder for files to add |
|
66 | + '', |
|
67 | + // what to use as identifier for collection entities |
|
68 | + // using CLASS NAME prevents duplicates (works like a singleton) |
|
69 | + CollectionDetails::ID_CLASS_NAME |
|
70 | + ), |
|
71 | + $this |
|
72 | + ); |
|
73 | + } |
|
74 | + } |
|
75 | 75 | |
76 | 76 | |
77 | - /** |
|
78 | - * @return CollectionInterface |
|
79 | - * @throws CollectionDetailsException |
|
80 | - * @throws CollectionLoaderException |
|
81 | - * @since 5.0.0.p |
|
82 | - */ |
|
83 | - public function loadInputs() |
|
84 | - { |
|
85 | - $this->loadCollection(); |
|
86 | - return $this->loader->getCollection(); |
|
87 | - } |
|
77 | + /** |
|
78 | + * @return CollectionInterface |
|
79 | + * @throws CollectionDetailsException |
|
80 | + * @throws CollectionLoaderException |
|
81 | + * @since 5.0.0.p |
|
82 | + */ |
|
83 | + public function loadInputs() |
|
84 | + { |
|
85 | + $this->loadCollection(); |
|
86 | + return $this->loader->getCollection(); |
|
87 | + } |
|
88 | 88 | |
89 | 89 | |
90 | - /** |
|
91 | - * getIdentifier |
|
92 | - * Overrides EventEspresso\core\services\collections\Collection::getIdentifier() |
|
93 | - * If no $identifier is supplied, then the fully qualified class name is used |
|
94 | - * |
|
95 | - * @param $object |
|
96 | - * @param mixed $identifier |
|
97 | - * @return bool |
|
98 | - */ |
|
99 | - public function getIdentifier($object, $identifier = null) |
|
100 | - { |
|
101 | - return ! empty($identifier) |
|
102 | - ? $identifier |
|
103 | - : get_class($object); |
|
104 | - } |
|
90 | + /** |
|
91 | + * getIdentifier |
|
92 | + * Overrides EventEspresso\core\services\collections\Collection::getIdentifier() |
|
93 | + * If no $identifier is supplied, then the fully qualified class name is used |
|
94 | + * |
|
95 | + * @param $object |
|
96 | + * @param mixed $identifier |
|
97 | + * @return bool |
|
98 | + */ |
|
99 | + public function getIdentifier($object, $identifier = null) |
|
100 | + { |
|
101 | + return ! empty($identifier) |
|
102 | + ? $identifier |
|
103 | + : get_class($object); |
|
104 | + } |
|
105 | 105 | } |