Skip to content

Commit 187a85d

Browse files
authored
Merged Pull Request '#5 psr-4->main : Introduce PSR-4 autoloading'
Introduce PSR-4 autoloading
2 parents 0bf222a + b127e1b commit 187a85d

13 files changed

+239
-263
lines changed

composer-dev.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@
2323
"license": "EUPL-1.2",
2424
"type": "library",
2525
"autoload": {
26-
"classmap": [
27-
"CloudRequestEngine.php",
28-
"CloudRequestException.php",
29-
"CloudEngine.php",
30-
"Constants.php",
31-
"HttpClient.php"
32-
]
26+
"psr-4": {
27+
"fiftyone\\pipeline\\cloudrequestengine\\": "src/"
28+
}
29+
},
30+
"autoload-dev": {
31+
"psr-4": {
32+
"fiftyone\\pipeline\\cloudrequestengine\\tests\\": "tests/"
33+
}
3334
},
3435
"repositories": [
3536
{

composer.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,21 @@
2222
],
2323
"license": "EUPL-1.2",
2424
"type": "library",
25-
"autoload": {
26-
"classmap": [
27-
"CloudRequestEngine.php",
28-
"CloudRequestException.php",
29-
"CloudEngine.php",
30-
"Constants.php",
31-
"HttpClient.php"
32-
]
33-
},
3425
"require": {
3526
"51degrees/fiftyone.pipeline.engines": "4.*",
3627
"51degrees/fiftyone.pipeline.core": "4.*"
28+
},
29+
"require-dev": {
30+
"phpunit/phpunit": "*"
31+
},
32+
"autoload": {
33+
"psr-4": {
34+
"fiftyone\\pipeline\\cloudrequestengine\\": "src/"
35+
}
36+
},
37+
"autoload-dev": {
38+
"psr-4": {
39+
"fiftyone\\pipeline\\cloudrequestengine\\tests\\": "tests/"
40+
}
3741
}
3842
}

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<phpunit>
1+
<phpunit bootstrap="vendor/autoload.php">
22
<php>
33
<env name="RESOURCEKEY" value="!!YOUR_RESOURCE_KEY!!"/>
44
</php>

CloudEngine.php renamed to src/CloudEngine.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
<?php
2-
/* *********************************************************************
3-
* This Original Work is copyright of 51 Degrees Mobile Experts Limited.
4-
* Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
5-
* Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
6-
*
7-
* This Original Work is licensed under the European Union Public Licence
8-
* (EUPL) v.1.2 and is subject to its terms as set out below.
9-
*
10-
* If a copy of the EUPL was not distributed with this file, You can obtain
11-
* one at https://opensource.org/licenses/EUPL-1.2.
12-
*
13-
* The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
14-
* amended by the European Commission) shall be deemed incompatible for
15-
* the purposes of the Work and the provisions of the compatibility
16-
* clause in Article 5 of the EUPL shall not apply.
17-
*
18-
* If using the Work as, or as part of, a network application, by
19-
* including the attribution notice(s) required under Article 5 of the EUPL
20-
* in the end user terms of the application under an appropriate heading,
21-
* such notice(s) shall fulfill the requirements of that article.
1+
<?php
2+
/* *********************************************************************
3+
* This Original Work is copyright of 51 Degrees Mobile Experts Limited.
4+
* Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
5+
* Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
6+
*
7+
* This Original Work is licensed under the European Union Public Licence
8+
* (EUPL) v.1.2 and is subject to its terms as set out below.
9+
*
10+
* If a copy of the EUPL was not distributed with this file, You can obtain
11+
* one at https://opensource.org/licenses/EUPL-1.2.
12+
*
13+
* The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
14+
* amended by the European Commission) shall be deemed incompatible for
15+
* the purposes of the Work and the provisions of the compatibility
16+
* clause in Article 5 of the EUPL shall not apply.
17+
*
18+
* If using the Work as, or as part of, a network application, by
19+
* including the attribution notice(s) required under Article 5 of the EUPL
20+
* in the end user terms of the application under an appropriate heading,
21+
* such notice(s) shall fulfill the requirements of that article.
2222
* ********************************************************************* */
2323

2424
namespace fiftyone\pipeline\cloudrequestengine;
Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
1-
<?php
2-
/* *********************************************************************
3-
* This Original Work is copyright of 51 Degrees Mobile Experts Limited.
4-
* Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
5-
* Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
6-
*
7-
* This Original Work is licensed under the European Union Public Licence
8-
* (EUPL) v.1.2 and is subject to its terms as set out below.
9-
*
10-
* If a copy of the EUPL was not distributed with this file, You can obtain
11-
* one at https://opensource.org/licenses/EUPL-1.2.
12-
*
13-
* The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
14-
* amended by the European Commission) shall be deemed incompatible for
15-
* the purposes of the Work and the provisions of the compatibility
16-
* clause in Article 5 of the EUPL shall not apply.
17-
*
18-
* If using the Work as, or as part of, a network application, by
19-
* including the attribution notice(s) required under Article 5 of the EUPL
20-
* in the end user terms of the application under an appropriate heading,
21-
* such notice(s) shall fulfill the requirements of that article.
1+
<?php
2+
/* *********************************************************************
3+
* This Original Work is copyright of 51 Degrees Mobile Experts Limited.
4+
* Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
5+
* Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
6+
*
7+
* This Original Work is licensed under the European Union Public Licence
8+
* (EUPL) v.1.2 and is subject to its terms as set out below.
9+
*
10+
* If a copy of the EUPL was not distributed with this file, You can obtain
11+
* one at https://opensource.org/licenses/EUPL-1.2.
12+
*
13+
* The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
14+
* amended by the European Commission) shall be deemed incompatible for
15+
* the purposes of the Work and the provisions of the compatibility
16+
* clause in Article 5 of the EUPL shall not apply.
17+
*
18+
* If using the Work as, or as part of, a network application, by
19+
* including the attribution notice(s) required under Article 5 of the EUPL
20+
* in the end user terms of the application under an appropriate heading,
21+
* such notice(s) shall fulfill the requirements of that article.
2222
* ********************************************************************* */
2323

2424

2525

2626
namespace fiftyone\pipeline\cloudrequestengine;
2727

28-
require(__DIR__ . "/Constants.php");
29-
3028
use fiftyone\pipeline\core\BasicListEvidenceKeyFilter;
3129
use fiftyone\pipeline\engines\AspectDataDictionary;
3230
use fiftyone\pipeline\engines\Engine;
@@ -150,7 +148,7 @@ private function getEngineProperties()
150148

151149
$properties = \json_decode($properties, true);
152150

153-
$properties = $this->LowerCaseArrayKeys($properties);
151+
$properties = $this->lowerCaseArrayKeys($properties);
154152

155153
$flowElementProperties = array();
156154

Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
<?php
2-
/* *********************************************************************
3-
* This Original Work is copyright of 51 Degrees Mobile Experts Limited.
4-
* Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
5-
* Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
6-
*
7-
* This Original Work is licensed under the European Union Public Licence
8-
* (EUPL) v.1.2 and is subject to its terms as set out below.
9-
*
10-
* If a copy of the EUPL was not distributed with this file, You can obtain
11-
* one at https://opensource.org/licenses/EUPL-1.2.
12-
*
13-
* The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
14-
* amended by the European Commission) shall be deemed incompatible for
15-
* the purposes of the Work and the provisions of the compatibility
16-
* clause in Article 5 of the EUPL shall not apply.
17-
*
18-
* If using the Work as, or as part of, a network application, by
19-
* including the attribution notice(s) required under Article 5 of the EUPL
20-
* in the end user terms of the application under an appropriate heading,
21-
* such notice(s) shall fulfill the requirements of that article.
1+
<?php
2+
/* *********************************************************************
3+
* This Original Work is copyright of 51 Degrees Mobile Experts Limited.
4+
* Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
5+
* Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
6+
*
7+
* This Original Work is licensed under the European Union Public Licence
8+
* (EUPL) v.1.2 and is subject to its terms as set out below.
9+
*
10+
* If a copy of the EUPL was not distributed with this file, You can obtain
11+
* one at https://opensource.org/licenses/EUPL-1.2.
12+
*
13+
* The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
14+
* amended by the European Commission) shall be deemed incompatible for
15+
* the purposes of the Work and the provisions of the compatibility
16+
* clause in Article 5 of the EUPL shall not apply.
17+
*
18+
* If using the Work as, or as part of, a network application, by
19+
* including the attribution notice(s) required under Article 5 of the EUPL
20+
* in the end user terms of the application under an appropriate heading,
21+
* such notice(s) shall fulfill the requirements of that article.
2222
* ********************************************************************* */
2323

2424
namespace fiftyone\pipeline\cloudrequestengine;
@@ -42,4 +42,4 @@ public function __construct($message, $httpStatusCode = 0, $responseHeaders = ar
4242
$this->responseHeaders = $responseHeaders;
4343

4444
}
45-
}
45+
}

Constants.php renamed to src/Constants.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
<?php
2-
/* *********************************************************************
3-
* This Original Work is copyright of 51 Degrees Mobile Experts Limited.
4-
* Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
5-
* Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
6-
*
7-
* This Original Work is licensed under the European Union Public Licence
8-
* (EUPL) v.1.2 and is subject to its terms as set out below.
9-
*
10-
* If a copy of the EUPL was not distributed with this file, You can obtain
11-
* one at https://opensource.org/licenses/EUPL-1.2.
12-
*
13-
* The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
14-
* amended by the European Commission) shall be deemed incompatible for
15-
* the purposes of the Work and the provisions of the compatibility
16-
* clause in Article 5 of the EUPL shall not apply.
17-
*
18-
* If using the Work as, or as part of, a network application, by
19-
* including the attribution notice(s) required under Article 5 of the EUPL
20-
* in the end user terms of the application under an appropriate heading,
21-
* such notice(s) shall fulfill the requirements of that article.
1+
<?php
2+
/* *********************************************************************
3+
* This Original Work is copyright of 51 Degrees Mobile Experts Limited.
4+
* Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
5+
* Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
6+
*
7+
* This Original Work is licensed under the European Union Public Licence
8+
* (EUPL) v.1.2 and is subject to its terms as set out below.
9+
*
10+
* If a copy of the EUPL was not distributed with this file, You can obtain
11+
* one at https://opensource.org/licenses/EUPL-1.2.
12+
*
13+
* The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
14+
* amended by the European Commission) shall be deemed incompatible for
15+
* the purposes of the Work and the provisions of the compatibility
16+
* clause in Article 5 of the EUPL shall not apply.
17+
*
18+
* If using the Work as, or as part of, a network application, by
19+
* including the attribution notice(s) required under Article 5 of the EUPL
20+
* in the end user terms of the application under an appropriate heading,
21+
* such notice(s) shall fulfill the requirements of that article.
2222
* ********************************************************************* */
2323

2424
namespace fiftyone\pipeline\cloudrequestengine;
@@ -88,4 +88,4 @@ class Constants {
8888
Constants::EVIDENCE_QUERY_PREFIX .
8989
Constants::EVIDENCE_SEPERATOR .
9090
Constants::EVIDENCE_NATIVE_MODEL_SUFFIX;
91-
}
91+
}

HttpClient.php renamed to src/HttpClient.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
<?php
2-
/* *********************************************************************
3-
* This Original Work is copyright of 51 Degrees Mobile Experts Limited.
4-
* Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
5-
* Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
6-
*
7-
* This Original Work is licensed under the European Union Public Licence
8-
* (EUPL) v.1.2 and is subject to its terms as set out below.
9-
*
10-
* If a copy of the EUPL was not distributed with this file, You can obtain
11-
* one at https://opensource.org/licenses/EUPL-1.2.
12-
*
13-
* The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
14-
* amended by the European Commission) shall be deemed incompatible for
15-
* the purposes of the Work and the provisions of the compatibility
16-
* clause in Article 5 of the EUPL shall not apply.
17-
*
18-
* If using the Work as, or as part of, a network application, by
19-
* including the attribution notice(s) required under Article 5 of the EUPL
20-
* in the end user terms of the application under an appropriate heading,
21-
* such notice(s) shall fulfill the requirements of that article.
1+
<?php
2+
/* *********************************************************************
3+
* This Original Work is copyright of 51 Degrees Mobile Experts Limited.
4+
* Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
5+
* Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
6+
*
7+
* This Original Work is licensed under the European Union Public Licence
8+
* (EUPL) v.1.2 and is subject to its terms as set out below.
9+
*
10+
* If a copy of the EUPL was not distributed with this file, You can obtain
11+
* one at https://opensource.org/licenses/EUPL-1.2.
12+
*
13+
* The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
14+
* amended by the European Commission) shall be deemed incompatible for
15+
* the purposes of the Work and the provisions of the compatibility
16+
* clause in Article 5 of the EUPL shall not apply.
17+
*
18+
* If using the Work as, or as part of, a network application, by
19+
* including the attribution notice(s) required under Article 5 of the EUPL
20+
* in the end user terms of the application under an appropriate heading,
21+
* such notice(s) shall fulfill the requirements of that article.
2222
* ********************************************************************* */
2323

2424

tests/CloudRequestEngineTests.php

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,31 @@
1-
<?php
2-
/* *********************************************************************
3-
* This Original Work is copyright of 51 Degrees Mobile Experts Limited.
4-
* Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
5-
* Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
6-
*
7-
* This Original Work is licensed under the European Union Public Licence
8-
* (EUPL) v.1.2 and is subject to its terms as set out below.
9-
*
10-
* If a copy of the EUPL was not distributed with this file, You can obtain
11-
* one at https://opensource.org/licenses/EUPL-1.2.
12-
*
13-
* The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
14-
* amended by the European Commission) shall be deemed incompatible for
15-
* the purposes of the Work and the provisions of the compatibility
16-
* clause in Article 5 of the EUPL shall not apply.
17-
*
18-
* If using the Work as, or as part of, a network application, by
19-
* including the attribution notice(s) required under Article 5 of the EUPL
20-
* in the end user terms of the application under an appropriate heading,
21-
* such notice(s) shall fulfill the requirements of that article.
1+
<?php
2+
/* *********************************************************************
3+
* This Original Work is copyright of 51 Degrees Mobile Experts Limited.
4+
* Copyright 2023 51 Degrees Mobile Experts Limited, Davidson House,
5+
* Forbury Square, Reading, Berkshire, United Kingdom RG1 3EU.
6+
*
7+
* This Original Work is licensed under the European Union Public Licence
8+
* (EUPL) v.1.2 and is subject to its terms as set out below.
9+
*
10+
* If a copy of the EUPL was not distributed with this file, You can obtain
11+
* one at https://opensource.org/licenses/EUPL-1.2.
12+
*
13+
* The 'Compatible Licences' set out in the Appendix to the EUPL (as may be
14+
* amended by the European Commission) shall be deemed incompatible for
15+
* the purposes of the Work and the provisions of the compatibility
16+
* clause in Article 5 of the EUPL shall not apply.
17+
*
18+
* If using the Work as, or as part of, a network application, by
19+
* including the attribution notice(s) required under Article 5 of the EUPL
20+
* in the end user terms of the application under an appropriate heading,
21+
* such notice(s) shall fulfill the requirements of that article.
2222
* ********************************************************************* */
2323

2424
namespace fiftyone\pipeline\cloudrequestengine\tests;
2525

26-
require(__DIR__ . "/../vendor/autoload.php");
27-
2826
use fiftyone\pipeline\cloudrequestengine\CloudRequestEngine;
2927
use fiftyone\pipeline\core\PipelineBuilder;
30-
use fiftyone\pipeline\cloudrequestengine\HttpClient;
3128
use fiftyone\pipeline\cloudrequestengine\Constants;
32-
use fiftyone\pipeline\cloudrequestengine\tests\CloudRequestEngineTestsBase;
33-
34-
use PHPUnit\Framework\TestCase;
3529

3630
class CloudRequestEngineTests extends CloudRequestEngineTestsBase {
3731
const testEndPoint="http://testEndPoint/";
@@ -271,4 +265,3 @@ public function testGetContent_case_insensitive($evidence, $expectedValue) {
271265
}
272266

273267
}
274-

0 commit comments

Comments
 (0)