Skip to content

Commit

Permalink
Merge pull request #2 from apimatic/add-php-7-1-to-7-4-to-travis
Browse files Browse the repository at this point in the history
Updated travis files with new PHP versions.
  • Loading branch information
thehappybug authored Apr 6, 2020
2 parents 9182bc9 + c31e197 commit 0883d38
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/README.html
/*.tgz
/dist/
/vendor/
/vendor*/
.buildpath
.project
.settings
/composer.lock
/composer*.lock
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
language: php
sudo: false
php:
- 5.4
- 5.5
- 5.6
- 7
- hhvm
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4

before_script:
- composer install --no-interaction --prefer-source --dev
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"issues": "https://github.com/apimatic/jsonmapper/issues"
},
"require-dev": {
"phpunit/phpunit": "4.2.*",
"squizlabs/php_codesniffer": "~1.5"
"phpunit/phpunit": "^5 || ^6 || ^7",
"squizlabs/php_codesniffer": "^3"
}
}
12 changes: 6 additions & 6 deletions src/JsonMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,11 @@ public function mapClass($json, $type)
*
* @param object|null $json JSON object structure from json_decode()
* @param \ReflectionClass $rc Class to get instance of. This method
* will try to first match the discriminator
* field with the discriminator value of
* the current class or its child class.
* If no matches is found, then the current
* class's instance is returned.
* will try to first match the discriminator
* field with the discriminator value of
* the current class or its child class.
* If no matches is found, then the current
* class's instance is returned.
*
* @return object|null Object instance if match is found.
*/
Expand Down Expand Up @@ -408,7 +408,7 @@ protected function getChildClasses($rc)
*/
protected function getFullNamespace($type, $strNs)
{
if ($type !== '' && $type{0} != '\\') {
if (\is_string($type) && $type !== '' && $type[0] != '\\') {
//create a full qualified namespace
if ($strNs != '') {
$type = '\\' . $strNs . '\\' . $type;
Expand Down
2 changes: 1 addition & 1 deletion tests/JsonMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @license OSL-3.0 http://opensource.org/licenses/osl-3.0
* @link http://www.netresearch.de/
*/
class JsonMapperTest extends \PHPUnit_Framework_TestCase
class JsonMapperTest extends \PHPUnit\Framework\TestCase
{
/**
* Test for "@var string"
Expand Down
2 changes: 1 addition & 1 deletion tests/namespacetest/NamespaceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

use apimatic\jsonmapper\JsonMapper;

class NamespaceTest extends \PHPUnit_Framework_TestCase
class NamespaceTest extends \PHPUnit\Framework\TestCase
{
public function testMapArrayNamespace()
{
Expand Down
3 changes: 1 addition & 2 deletions tests/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
colors="true"
beStrictAboutChangesToGlobalState="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTestSize="true"
beStrictAboutTestsThatDoNotTestAnything="true"
checkForUnintentionallyCoveredCode="true"
beStrictAboutCoversAnnotation="true"
>
<filter>
<whitelist>
Expand Down

0 comments on commit 0883d38

Please sign in to comment.