Skip to content

Commit

Permalink
Introduce class name changes in new namespace (#227)
Browse files Browse the repository at this point in the history
* introduce class name changes in new namespace

This introduces the class name changes proposed with #213 into the v1.x series according to the migration strategy detailed in  #221.

* fix various type hints
  • Loading branch information
mikey179 authored Mar 23, 2020
1 parent a76d213 commit 53be878
Show file tree
Hide file tree
Showing 58 changed files with 2,352 additions and 296 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@

* Namespace changed from `org\bovigo\vfs` to `bovigo\vfs`
- The old namespace still works, but has been deprecated. It will be removed in version 2.
* Renamed some classes in the new namespace. When moving your code to the new namespace please be aware of the following name changes:
- `org\bovigo\vfs\vfsStreamBlock` => `bovigo\vfs\vfsBlock`
- `org\bovigo\vfs\vfsStreamContainerIterator` => `bovigo\vfs\vfsDirectoryIterator`
- `org\bovigo\vfs\vfsStreamDirectory` => `bovigo\vfs\vfsDirectory`
- `org\bovigo\vfs\vfsStreamFile` => `bovigo\vfs\vfsFile`
- `org\bovigo\vfs\vfsStreamWrapper` => `bovigo\vfs\StreamWrapper`
- `org\bovigo\vfs\visitor\vfsStreamAbstractVisitor` => `bovigo\vfs\visitor\BaseVisitor`
- `org\bovigo\vfs\visitor\vfsStreamPrintVisitor` => `bovigo\vfs\visitor\Printer`
- `org\bovigo\vfs\visitor\vfsStreamStructureVisitor` => `bovigo\vfs\visitor\StructureInspector`
- `org\bovigo\vfs\vfsStreamAbstractContent` => `bovigo\vfs\BasicFile`
* Deprecated (internal) classes and interfaces, they will be removed in version 2.
- `org\bovigo\vfs\vfsStreamContent`
- `org\bovigo\vfs\vfsStreamContainer`
- `org\bovigo\vfs\content\SeekableFileContent`
* raised requirement for minimum PHP version to 5.6.0


Expand Down
4 changes: 2 additions & 2 deletions org/bovigo/vfs/content/SeekableFileContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

class_exists('bovigo\vfs\content\SeekableFileContent');

@trigger_error('Using the "org\bovigo\vfs\content\SeekableFileContent" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\content\SeekableFileContent" instead.', E_USER_DEPRECATED);
@trigger_error('Using the "org\bovigo\vfs\content\SeekableFileContent" class is deprecated since version 1.7 and will be removed in version 2.', E_USER_DEPRECATED);

if (\false) {
/** @deprecated since 1.7, use "bovigo\vfs\SeekableFileContent" instead */
/** @deprecated since 1.7, will be removed in version 2 */
abstract class SeekableFileContent extends Base
{
}
Expand Down
8 changes: 4 additions & 4 deletions org/bovigo/vfs/vfsStreamAbstractContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace org\bovigo\vfs;

use bovigo\vfs\vfsStreamAbstractContent as Base;
use bovigo\vfs\BasicFile as Base;

class_exists('bovigo\vfs\vfsStreamAbstractContent');
class_exists('bovigo\vfs\BasicFile');

@trigger_error('Using the "org\bovigo\vfs\vfsStreamAbstractContent" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\vfsStreamAbstractContent" instead.', E_USER_DEPRECATED);
@trigger_error('Using the "org\bovigo\vfs\vfsStreamAbstractContent" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\BasicFile" instead.', E_USER_DEPRECATED);

if (\false) {
/** @deprecated since 1.7, use "bovigo\vfs\vfsStreamAbstractContent" instead */
/** @deprecated since 1.7, use "bovigo\vfs\BasicFile" instead */
abstract class vfsStreamAbstractContent extends Base
{
}
Expand Down
8 changes: 4 additions & 4 deletions org/bovigo/vfs/vfsStreamBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace org\bovigo\vfs;

use bovigo\vfs\vfsStreamBlock as Base;
use bovigo\vfs\vfsBlock as Base;

class_exists('bovigo\vfs\vfsStreamBlock');
class_exists('bovigo\vfs\vfsBlock');

@trigger_error('Using the "org\bovigo\vfs\vfsStreamBlock" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\vfsStreamBlock" instead.', E_USER_DEPRECATED);
@trigger_error('Using the "org\bovigo\vfs\vfsStreamBlock" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\vfsBlock" instead.', E_USER_DEPRECATED);

if (\false) {
/** @deprecated since 1.7, use "bovigo\vfs\vfsStreamBlock" instead */
/** @deprecated since 1.7, use "bovigo\vfs\vfsBlock" instead */
class vfsStreamBlock extends Base
{
}
Expand Down
4 changes: 2 additions & 2 deletions org/bovigo/vfs/vfsStreamContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

interface_exists('bovigo\vfs\vfsStreamContainer');

@trigger_error('Using the "org\bovigo\vfs\vfsStreamContainer" interface is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\vfsStreamContainer" instead.', E_USER_DEPRECATED);
@trigger_error('Using the "org\bovigo\vfs\vfsStreamContainer" interface is deprecated since version 1.7 and will be removed in version 2.', E_USER_DEPRECATED);

if (\false) {
/** @deprecated since 1.7, use "bovigo\vfs\vfsStreamContainer" instead */
/** @deprecated since 1.7, will be removed in version 2 */
interface vfsStreamContainer extends Base
{
}
Expand Down
8 changes: 4 additions & 4 deletions org/bovigo/vfs/vfsStreamContainerIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace org\bovigo\vfs;

use bovigo\vfs\vfsStreamContainerIterator as Base;
use bovigo\vfs\vfsDirectoryIterator as Base;

class_exists('bovigo\vfs\vfsStreamContainerIterator');
class_exists('bovigo\vfs\vfsDirectoryIterator');

@trigger_error('Using the "org\bovigo\vfs\vfsStreamContainerIterator" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\vfsStreamContainerIterator" instead.', E_USER_DEPRECATED);
@trigger_error('Using the "org\bovigo\vfs\vfsStreamContainerIterator" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\vfsDirectoryIterator" instead.', E_USER_DEPRECATED);

if (\false) {
/** @deprecated since 1.7, use "bovigo\vfs\vfsStreamContainerIterator" instead */
/** @deprecated since 1.7, use "bovigo\vfs\vfsDirectoryIterator" instead */
class vfsStreamContainerIterator extends Base
{
}
Expand Down
8 changes: 4 additions & 4 deletions org/bovigo/vfs/vfsStreamDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace org\bovigo\vfs;

use bovigo\vfs\vfsStreamDirectory as Base;
use bovigo\vfs\vfsDirectory as Base;

class_exists('bovigo\vfs\vfsStreamDirectory');
class_exists('bovigo\vfs\vfsDirectory');

@trigger_error('Using the "org\bovigo\vfs\vfsStreamDirectory" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\vfsStreamDirectory" instead.', E_USER_DEPRECATED);
@trigger_error('Using the "org\bovigo\vfs\vfsStreamDirectory" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\vfsDirectory" instead.', E_USER_DEPRECATED);

if (\false) {
/** @deprecated since 1.7, use "bovigo\vfs\vfsStreamDirectory" instead */
/** @deprecated since 1.7, use "bovigo\vfs\vfsDirectory" instead */
class vfsStreamDirectory extends Base
{
}
Expand Down
8 changes: 4 additions & 4 deletions org/bovigo/vfs/vfsStreamFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace org\bovigo\vfs;

use bovigo\vfs\vfsStreamFile as Base;
use bovigo\vfs\vfsFile as Base;

class_exists('bovigo\vfs\vfsStreamFile');
class_exists('bovigo\vfs\vfsFile');

@trigger_error('Using the "org\bovigo\vfs\vfsStreamFile" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\vfsStreamFile" instead.', E_USER_DEPRECATED);
@trigger_error('Using the "org\bovigo\vfs\vfsStreamFile" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\vfsFile" instead.', E_USER_DEPRECATED);

if (\false) {
/** @deprecated since 1.7, use "bovigo\vfs\vfsStreamFile" instead */
/** @deprecated since 1.7, use "bovigo\vfs\vfsFile" instead */
class vfsStreamFile extends Base
{
}
Expand Down
8 changes: 4 additions & 4 deletions org/bovigo/vfs/vfsStreamWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace org\bovigo\vfs;

use bovigo\vfs\vfsStreamWrapper as Base;
use bovigo\vfs\StreamWrapper as Base;

class_exists('bovigo\vfs\vfsStreamWrapper');
class_exists('bovigo\vfs\StreamWrapper');

@trigger_error('Using the "org\bovigo\vfs\vfsStreamWrapper" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\vfsStreamWrapper" instead.', E_USER_DEPRECATED);
@trigger_error('Using the "org\bovigo\vfs\vfsStreamWrapper" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\StreamWrapper" instead.', E_USER_DEPRECATED);

if (\false) {
/** @deprecated since 1.7, use "bovigo\vfs\vfsStreamWrapper" instead */
/** @deprecated since 1.7, use "bovigo\vfs\StreamWrapper" instead */
class vfsStreamWrapper extends Base
{
}
Expand Down
10 changes: 5 additions & 5 deletions org/bovigo/vfs/visitor/vfsStreamAbstractVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace org\bovigo\vfs\visitor;

use bovigo\vfs\visitor\vfsStreamAbstractVisitor as Base;
use bovigo\vfs\visitor\BaseVisitor;

class_exists('bovigo\vfs\visitor\vfsStreamAbstractVisitor');
class_exists('bovigo\vfs\visitor\BaseVisitor');

@trigger_error('Using the "org\bovigo\vfs\visitor\vfsStreamAbstractVisitor" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\visitor\vfsStreamAbstractVisitor" instead.', E_USER_DEPRECATED);
@trigger_error('Using the "org\bovigo\vfs\visitor\vfsStreamAbstractVisitor" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\visitor\BaseVisitor" instead.', E_USER_DEPRECATED);

if (\false) {
/** @deprecated since 1.7, use "bovigo\vfs\vfsStreamAbstractVisitor" instead */
abstract class vfsStreamAbstractVisitor extends Base
/** @deprecated since 1.7, use "bovigo\vfs\BaseVisitor" instead */
abstract class vfsStreamAbstractVisitor extends BaseVisitor
{
}
}
8 changes: 4 additions & 4 deletions org/bovigo/vfs/visitor/vfsStreamPrintVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace org\bovigo\vfs\visitor;

use bovigo\vfs\visitor\vfsStreamPrintVisitor as Base;
use bovigo\vfs\visitor\Printer as Base;

class_exists('bovigo\vfs\visitor\vfsStreamPrintVisitor');
class_exists('bovigo\vfs\visitor\Printer');

@trigger_error('Using the "org\bovigo\vfs\visitor\vfsStreamPrintVisitor" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\visitor\vfsStreamPrintVisitor" instead.', E_USER_DEPRECATED);
@trigger_error('Using the "org\bovigo\vfs\visitor\vfsStreamPrintVisitor" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\visitor\Printer" instead.', E_USER_DEPRECATED);

if (\false) {
/** @deprecated since 1.7, use "bovigo\vfs\vfsStreamPrintVisitor" instead */
/** @deprecated since 1.7, use "bovigo\vfs\Printer" instead */
class vfsStreamPrintVisitor extends Base
{
}
Expand Down
8 changes: 4 additions & 4 deletions org/bovigo/vfs/visitor/vfsStreamStructureVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace org\bovigo\vfs\visitor;

use bovigo\vfs\visitor\vfsStreamStructureVisitor as Base;
use bovigo\vfs\visitor\StructureInspector as Base;

class_exists('bovigo\vfs\visitor\vfsStreamStructureVisitor');
class_exists('bovigo\vfs\visitor\StructureInspector');

@trigger_error('Using the "org\bovigo\vfs\visitor\vfsStreamStructureVisitor" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\visitor\vfsStreamStructureVisitor" instead.', E_USER_DEPRECATED);
@trigger_error('Using the "org\bovigo\vfs\visitor\vfsStreamStructureVisitor" class is deprecated since version 1.7 and will be removed in version 2, use "bovigo\vfs\visitor\StructureInspector" instead.', E_USER_DEPRECATED);

if (\false) {
/** @deprecated since 1.7, use "bovigo\vfs\vfsStreamStructureVisitor" instead */
/** @deprecated since 1.7, use "bovigo\vfs\StructureInspector" instead */
class vfsStreamStructureVisitor extends Base
{
}
Expand Down
4 changes: 2 additions & 2 deletions src/vfsStreamAbstractContent.php → src/BasicFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Base stream contents container.
*/
abstract class vfsStreamAbstractContent implements vfsStreamContent
abstract class BasicFile implements vfsStreamContent
{
/**
* name of the container
Expand Down Expand Up @@ -426,4 +426,4 @@ public function url()
}
}

class_alias('bovigo\vfs\vfsStreamAbstractContent', 'org\bovigo\vfs\vfsStreamAbstractContent');
class_alias('bovigo\vfs\BasicFile', 'org\bovigo\vfs\vfsStreamAbstractContent');
4 changes: 2 additions & 2 deletions src/DotDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
/**
* Directory container.
*/
class DotDirectory extends vfsStreamDirectory
class DotDirectory extends vfsDirectory
{
/**
* returns iterator for the children
*
* @return vfsStreamContainerIterator
* @return vfsDirectoryIterator
*/
public function getIterator()
{
Expand Down
18 changes: 9 additions & 9 deletions src/vfsStreamWrapper.php → src/StreamWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
/**
* Stream wrapper to mock file system requests.
*/
class vfsStreamWrapper
class StreamWrapper
{
/**
* open file for reading
Expand Down Expand Up @@ -111,19 +111,19 @@ class vfsStreamWrapper
/**
* shortcut to file container
*
* @type vfsStreamFile
* @type vfsFile
*/
protected $content;
/**
* shortcut to directory container
*
* @type vfsStreamDirectory
* @type vfsDirectory
*/
protected $dir;
/**
* shortcut to directory container iterator
*
* @type vfsStreamDirectory
* @type vfsDirectory
*/
protected $dirIterator;

Expand Down Expand Up @@ -612,12 +612,12 @@ function() use ($content, $var)
/**
* executes given permission change when necessary rights allow such a change
*
* @param string $path
* @param vfsStreamAbstractContent $content
* @param \Closure $change
* @param string $path
* @param BasicFile $content
* @param \Closure $change
* @return bool
*/
private function doPermChange($path, vfsStreamAbstractContent $content, \Closure $change)
private function doPermChange($path, BasicFile $content, \Closure $change)
{
if (!$content->isOwnedByUser(vfsStream::getCurrentUser())) {
return false;
Expand Down Expand Up @@ -1049,4 +1049,4 @@ public function url_stat($path, $flags)
}
}

class_alias('bovigo\vfs\vfsStreamWrapper', 'org\bovigo\vfs\vfsStreamWrapper');
class_alias('bovigo\vfs\StreamWrapper', 'org\bovigo\vfs\vfsStreamWrapper');
1 change: 1 addition & 0 deletions src/content/SeekableFileContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Default implementation for file contents based on simple strings.
*
* @since 1.3.0
* @deprecated since 1.7, will be removed in version 2
*/
abstract class SeekableFileContent implements FileContent
{
Expand Down
4 changes: 2 additions & 2 deletions src/vfsStreamBlock.php → src/vfsBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* @api
*/
class vfsStreamBlock extends vfsStreamFile
class vfsBlock extends vfsFile
{
/**
* constructor
Expand All @@ -36,4 +36,4 @@ public function __construct($name, $permissions = null)
}
}

class_alias('bovigo\vfs\vfsStreamBlock', 'org\bovigo\vfs\vfsStreamBlock');
class_alias('bovigo\vfs\vfsBlock', 'org\bovigo\vfs\vfsStreamBlock');
8 changes: 4 additions & 4 deletions src/vfsStreamDirectory.php → src/vfsDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @api
*/
class vfsStreamDirectory extends vfsStreamAbstractContent implements vfsStreamContainer
class vfsDirectory extends BasicFile implements vfsStreamContainer
{
/**
* list of directory children
Expand Down Expand Up @@ -253,11 +253,11 @@ public function getChildren()
/**
* returns iterator for the children
*
* @return vfsStreamContainerIterator
* @return vfsDirectoryIterator
*/
public function getIterator()
{
return new vfsStreamContainerIterator($this->children);
return new vfsDirectoryIterator($this->children);
}

/**
Expand All @@ -275,4 +275,4 @@ public function isDot()
}
}

class_alias('bovigo\vfs\vfsStreamDirectory', 'org\bovigo\vfs\vfsStreamDirectory');
class_alias('bovigo\vfs\vfsDirectory', 'org\bovigo\vfs\vfsStreamDirectory');
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Iterator for children of a directory container.
*/
class vfsStreamContainerIterator implements \Iterator
class vfsDirectoryIterator implements \Iterator
{
/**
* list of children from container to iterate over
Expand Down Expand Up @@ -101,4 +101,4 @@ public function valid()
}
}

class_alias('bovigo\vfs\vfsStreamContainerIterator', 'org\bovigo\vfs\vfsStreamContainerIterator');
class_alias('bovigo\vfs\vfsDirectoryIterator', 'org\bovigo\vfs\vfsStreamContainerIterator');
Loading

0 comments on commit 53be878

Please sign in to comment.