Skip to content

Commit 0de9941

Browse files
authored
Merge pull request #198 from php-opencloud/php-7.2
Merge branch php-7.2 to master
2 parents e70b58e + 2346777 commit 0de9941

File tree

34 files changed

+150
-74
lines changed

34 files changed

+150
-74
lines changed

.php_cs.dist

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
if (!file_exists(__DIR__.'/src')) {
3+
exit(0);
4+
}
5+
return PhpCsFixer\Config::create()
6+
->setRules(
7+
[
8+
'@PSR2' => true,
9+
'array_syntax' => ['syntax' => 'short'],
10+
'protected_to_private' => false
11+
]
12+
)
13+
->setUsingCache(false)
14+
->setRiskyAllowed(true)
15+
->setFinder(
16+
PhpCsFixer\Finder::create()
17+
->in(__DIR__.'/src')
18+
->append([__FILE__, __DIR__.'/samples'])
19+
);

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ language: php
22

33
sudo: false
44

5-
dist: precise
6-
75
cache:
86
directories:
97
- $HOME/.composer/cache
@@ -12,6 +10,7 @@ matrix:
1210
include:
1311
- php: 7.0
1412
- php: 7.1
13+
- php: 7.2
1514
- php: nightly
1615
allow_failures:
1716
- php: nightly
@@ -25,7 +24,7 @@ before_install:
2524
before_script:
2625
- composer install --prefer-source
2726
- vendor/bin/parallel-lint --exclude vendor .
28-
- vendor/bin/php-cs-fixer fix --dry-run --diff --level psr2 .
27+
- vendor/bin/php-cs-fixer fix --dry-run --diff
2928
- phpenv config-add ./xdebug.ini
3029

3130
after_script:

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,23 @@ OpenStack services, and versions of services, are supported.
1212

1313
* [Official documentation](http://docs.os.php-opencloud.com/)
1414
* [Reference documentation](http://refdocs.os.php-opencloud.com)
15-
* [Developer support](https://developer.rackspace.com/)
16-
* [Mailing list](https://groups.google.com/forum/#!forum/php-opencloud)
1715
* [Contributing guide](/CONTRIBUTING.md)
1816
* [Code of Conduct](/CODE_OF_CONDUCT.md)
1917

18+
## Backward incompatibility
19+
20+
Due to new [object typehint](https://wiki.php.net/rfc/object-typehint) since PHP 7.2, `Object` is a reserved keyword
21+
thus class `OpenStack\ObjectStore\v1\Models\Object` had to be renamed to
22+
`OpenStack\ObjectStore\v1\Models\StorageObject`. See [#184](https://github.com/php-opencloud/openstack/pull/184) for
23+
details.
24+
25+
### Version Guidance
26+
27+
| Version | Status | PHP Version | Life span |
28+
| --------- | --------------------------- | ------------- | ----------------------- |
29+
| `^2.0` | Maintained (Bug fixes only) | `^=7.0,<7.2` | March 2016 - March 2018 |
30+
| `^3.0` | Latest | `^7.0` | March 2018 - March 2020 |
31+
2032
## Getting help
2133

2234
- Meet us on Slack: https://phpopencloud.slack.com ([Get your invitation](https://launchpass.com/phpopencloud))

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444
"justinrainbow/json-schema": "~5.2"
4545
},
4646
"require-dev": {
47-
"phpunit/phpunit": "~4.0",
47+
"phpunit/phpunit": "^6.5",
4848
"sami/sami": "dev-master",
4949
"psr/log": "~1.0",
5050
"satooshi/php-coveralls": "~1.0",
5151
"jakub-onderka/php-parallel-lint": "0.*",
52-
"friendsofphp/php-cs-fixer": "^1.0"
52+
"friendsofphp/php-cs-fixer": "^2.9"
5353
}
5454
}

doc/services/object-store/v1/objects.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Download an object
2727
------------------
2828

2929
.. sample:: object_store/v1/objects/download.php
30-
.. refdoc:: OpenStack/ObjectStore/v1/Models/Object.html#method_download
30+
.. refdoc:: OpenStack/ObjectStore/v1/Models/StorageObject.html#method_download
3131

3232
As you will notice, a Stream_ object is returned by this call. For more information about dealing with streams, please
3333
consult `Guzzle's docs`_.
@@ -88,19 +88,19 @@ Copy object
8888
-----------
8989

9090
.. sample:: object_store/v1/objects/copy.php
91-
.. refdoc:: OpenStack/ObjectStore/v1/Models/Object.html#method_copy
91+
.. refdoc:: OpenStack/ObjectStore/v1/Models/StorageObject.html#method_copy
9292

9393
Delete object
9494
-------------
9595

9696
.. sample:: object_store/v1/objects/delete.php
97-
.. refdoc:: OpenStack/ObjectStore/v1/Models/Object.html#method_delete
97+
.. refdoc:: OpenStack/ObjectStore/v1/Models/StorageObject.html#method_delete
9898

9999
Get metadata
100100
------------
101101

102102
.. sample:: object_store/v1/objects/get_metadata.php
103-
.. refdoc:: OpenStack/ObjectStore/v1/Models/Object.html#method_getMetadata
103+
.. refdoc:: OpenStack/ObjectStore/v1/Models/StorageObject.html#method_getMetadata
104104

105105
The returned value will be a standard associative array, or hash, containing arbitrary key/value pairs. These will
106106
correspond to the values set either when the object was created, or when a previous ``mergeMetadata`` or
@@ -110,7 +110,7 @@ Replace all metadata with new values
110110
------------------------------------
111111

112112
.. sample:: object_store/v1/objects/reset_metadata.php
113-
.. refdoc:: OpenStack/ObjectStore/v1/Models/Object.html#method_resetMetadata
113+
.. refdoc:: OpenStack/ObjectStore/v1/Models/StorageObject.html#method_resetMetadata
114114

115115
In order to replace all existing metadata with a set of new values, you can use this operation. Any existing metadata
116116
items which not specified in the new set will be removed. For example, say an account has the following metadata
@@ -140,7 +140,7 @@ Merge new metadata values with existing
140140
---------------------------------------
141141

142142
.. sample:: object_store/v1/objects/merge_metadata.php
143-
.. refdoc:: OpenStack/ObjectStore/v1/Models/Object.html#method_mergeMetadata
143+
.. refdoc:: OpenStack/ObjectStore/v1/Models/StorageObject.html#method_mergeMetadata
144144

145145
In order to merge a set of new metadata values with the existing metadata set, you can use this operation. Any existing
146146
metadata items which are not specified in the new set will be preserved. For example, say an account has the following

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="./vendor/autoload.php" colors="true">
2+
<phpunit bootstrap="./vendor/autoload.php" colors="true" strict="true">
33

44
<testsuites>
55
<testsuite name="OpenStack">

samples/object_store/v1/objects/create.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
'content' => '{objectContent}',
1818
];
1919

20-
/** @var \OpenStack\ObjectStore\v1\Models\Object $object */
20+
/** @var \OpenStack\ObjectStore\v1\Models\StorageObject $object */
2121
$object = $openstack->objectStoreV1()
2222
->getContainer('{containerName}')
2323
->createObject($options);

samples/object_store/v1/objects/create_from_stream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'stream' => $stream,
2323
];
2424

25-
/** @var \OpenStack\ObjectStore\v1\Models\Object $object */
25+
/** @var \OpenStack\ObjectStore\v1\Models\StorageObject $object */
2626
$object = $openstack->objectStoreV1()
2727
->getContainer('{containerName}')
2828
->createObject($options);

samples/object_store/v1/objects/create_large_object.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
$options['segmentContainer'] = 'test_segments';
2828

2929

30-
/** @var \OpenStack\ObjectStore\v1\Models\Object $object */
30+
/** @var \OpenStack\ObjectStore\v1\Models\StorageObject $object */
3131
$object = $openstack->objectStoreV1()
3232
->getContainer('test')
3333
->createLargeObject($options);

samples/object_store/v1/objects/get.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
'scope' => ['project' => ['id' => '{projectId}']]
1313
]);
1414

15-
/** @var \OpenStack\ObjectStore\v1\Models\Object $object */
15+
/** @var \OpenStack\ObjectStore\v1\Models\StorageObject $object */
1616
$object = $openstack->objectStoreV1()
1717
->getContainer('{containerName}')
1818
->getObject('{objectName}');

0 commit comments

Comments
 (0)