From feaf925bec85fec6d3e0f7f41f717f0d314d8970 Mon Sep 17 00:00:00 2001 From: adlawson Date: Tue, 21 Jul 2015 15:09:37 +0100 Subject: [PATCH] Remove unnecessary `@inheritdoc` docblocks They're not needed to inherit parent documentation and are overly all up in my grill. --- src/FileSystem.php | 21 ------------ src/FileSystemRegistry.php | 12 ------- src/Logger/PhpErrorLogger.php | 5 --- src/Node/Directory.php | 40 ----------------------- src/Node/Factory/NodeFactory.php | 16 --------- src/Node/Factory/NodeFactoryInterface.php | 6 ++++ src/Node/File.php | 27 --------------- src/Node/Walker/NodeWalker.php | 11 ------- src/Node/Walker/NodeWalkerInterface.php | 8 +++++ src/Stream/AbstractHandle.php | 8 ----- src/Stream/DirectoryHandle.php | 22 ------------- src/Stream/FileHandle.php | 27 --------------- 12 files changed, 14 insertions(+), 189 deletions(-) diff --git a/src/FileSystem.php b/src/FileSystem.php index bef36f8..7532bc4 100644 --- a/src/FileSystem.php +++ b/src/FileSystem.php @@ -61,49 +61,31 @@ class FileSystem implements FileSystemInterface return $builder->build(); } - /** - * {@inheritdoc} - */ public function get($path) { return $this->walker->findNode($this->root, $path); } - /** - * {@inheritdoc} - */ public function getLogger() { return $this->logger; } - /** - * {@inheritdoc} - */ public function getNodeFactory() { return $this->factory; } - /** - * {@inheritdoc} - */ public function getNodeWalker() { return $this->walker; } - /** - * @return string - */ public function getScheme() { return $this->scheme; } - /** - * {@inheritdoc} - */ public function mount() { if ($this->registry->has($this->scheme) || in_array($this->scheme, stream_get_wrappers())) { @@ -119,9 +101,6 @@ class FileSystem implements FileSystemInterface return false; } - /** - * {@inheritdoc} - */ public function unmount() { if (!$this->registry->has($this->scheme) && !in_array($this->scheme, stream_get_wrappers())) { diff --git a/src/FileSystemRegistry.php b/src/FileSystemRegistry.php index 7541fb2..886c188 100644 --- a/src/FileSystemRegistry.php +++ b/src/FileSystemRegistry.php @@ -39,9 +39,6 @@ class FileSystemRegistry implements RegistryInterface return self::$instance; } - /** - * {@inheritdoc} - */ public function add($scheme, FileSystemInterface $fs) { if ($this->has($scheme)) { @@ -51,9 +48,6 @@ class FileSystemRegistry implements RegistryInterface $this->registered[$scheme] = $fs; } - /** - * {@inheritdoc} - */ public function get($scheme) { if (!$this->has($scheme)) { @@ -63,17 +57,11 @@ class FileSystemRegistry implements RegistryInterface return $this->registered[$scheme]; } - /** - * {@inheritdoc} - */ public function has($scheme) { return isset($this->registered[$scheme]); } - /** - * {@inheritdoc} - */ public function remove($scheme) { if (!$this->has($scheme)) { diff --git a/src/Logger/PhpErrorLogger.php b/src/Logger/PhpErrorLogger.php index a0a977e..5948524 100644 --- a/src/Logger/PhpErrorLogger.php +++ b/src/Logger/PhpErrorLogger.php @@ -14,11 +14,6 @@ use Psr\Log\LogLevel; class PhpErrorLogger extends AbstractLogger { - /** - * @param mixed $level - * @param string $message - * @param array $context - */ public function log($level, $message, array $context = []) { switch ($level) { diff --git a/src/Node/Directory.php b/src/Node/Directory.php index 34981d5..f1d6902 100644 --- a/src/Node/Directory.php +++ b/src/Node/Directory.php @@ -43,9 +43,6 @@ class Directory implements NodeContainerInterface $this->set(self::DOT_SELF, $this); } - /** - * {@inheritdoc} - */ public function add($name, NodeInterface $node) { if ($this->has($name)) { @@ -55,9 +52,6 @@ class Directory implements NodeContainerInterface $this->set($name, $node); } - /** - * {@inheritdoc} - */ public function get($name) { if (!$this->has($name)) { @@ -67,17 +61,11 @@ class Directory implements NodeContainerInterface return $this->nodes[$name]; } - /** - * {@inheritdoc} - */ public function has($name) { return isset($this->nodes[$name]); } - /** - * {@inheritdoc} - */ public function remove($name) { if (!$this->has($name)) { @@ -87,10 +75,6 @@ class Directory implements NodeContainerInterface unset($this->nodes[$name]); } - /** - * @param string $name - * @param NodeInterface $node - */ public function set($name, NodeInterface $node) { $this->nodes[$name] = $node; @@ -100,65 +84,41 @@ class Directory implements NodeContainerInterface } } - /** - * {@inheritdoc} - */ public function getDateAccessed() { return $this->dateAccessed; } - /** - * @param DateTime $dateTime - */ public function setDateAccessed(DateTime $dateTime) { $this->dateAccessed = $dateTime; } - /** - * {@inheritdoc} - */ public function getDateCreated() { return $this->dateCreated; } - /** - * {@inheritdoc} - */ public function getDateModified() { return $this->dateModified; } - /** - * @param DateTime $dateTime - */ public function setDateModified(DateTime $dateTime) { $this->dateModified = $dateTime; } - /** - * {@inheritdoc} - */ public function getIterator() { return new ArrayIterator($this->nodes); } - /** - * {@inheritdoc} - */ public function getMode() { return $this->mode; } - /** - * {@inheritdoc} - */ public function getSize() { $size = 0; diff --git a/src/Node/Factory/NodeFactory.php b/src/Node/Factory/NodeFactory.php index 3b15a43..5403028 100644 --- a/src/Node/Factory/NodeFactory.php +++ b/src/Node/Factory/NodeFactory.php @@ -17,37 +17,21 @@ use Vfs\Node\NodeInterface; class NodeFactory implements NodeFactoryInterface { - /** - * @param NodeInterface[] $children - * @return NodeContainerInterface - */ public function buildDirectory(array $children = []) { return new Directory($children); } - /** - * @param string $content - * @return NodeInterface - */ public function buildFile($content = '') { return new File($content); } - /** - * @param string $content - * @return NodeInterface - */ public function buildLink($content = '') { throw new LogicException('Symlinks aren\'t supported yet.'); } - /** - * @param array $tree - * @return NodeContainerInterface - */ public function buildTree(array $tree) { $nodes = []; diff --git a/src/Node/Factory/NodeFactoryInterface.php b/src/Node/Factory/NodeFactoryInterface.php index ca2ffca..5da1ed4 100644 --- a/src/Node/Factory/NodeFactoryInterface.php +++ b/src/Node/Factory/NodeFactoryInterface.php @@ -31,4 +31,10 @@ interface NodeFactoryInterface * @return NodeInterface */ public function buildLink($content = ''); + + /** + * @param array $tree + * @return NodeContainerInterface + */ + public function buildTree(array $tree); } diff --git a/src/Node/File.php b/src/Node/File.php index a8c6c2d..5788903 100644 --- a/src/Node/File.php +++ b/src/Node/File.php @@ -32,73 +32,46 @@ class File implements FileInterface $this->dateModified = clone $this->dateAccessed; } - /** - * {@inheritdoc} - */ public function getContent() { return $this->content; } - /** - * {@inheritdoc} - */ public function setContent($content) { $this->content = (string) $content; } - /** - * {@inheritdoc} - */ public function getDateAccessed() { return $this->dateAccessed; } - /** - * @param DateTime $dateTime - */ public function setDateAccessed(DateTime $dateTime) { $this->dateAccessed = $dateTime; } - /** - * {@inheritdoc} - */ public function getDateCreated() { return $this->dateCreated; } - /** - * {@inheritdoc} - */ public function getDateModified() { return $this->dateModified; } - /** - * @param DateTime $dateTime - */ public function setDateModified(DateTime $dateTime) { $this->dateModified = $dateTime; } - /** - * {@inheritdoc} - */ public function getMode() { return $this->mode; } - /** - * {@inheritdoc} - */ public function getSize() { return strlen($this->content); diff --git a/src/Node/Walker/NodeWalker.php b/src/Node/Walker/NodeWalker.php index b220efd..af523a9 100644 --- a/src/Node/Walker/NodeWalker.php +++ b/src/Node/Walker/NodeWalker.php @@ -24,11 +24,6 @@ class NodeWalker implements NodeWalkerInterface $this->separator = $separator; } - /** - * @param NodeInterface $root - * @param string $path - * @return NodeInterface - */ public function findNode(NodeInterface $root, $path) { $parts = $this->splitPath($path); @@ -43,12 +38,6 @@ class NodeWalker implements NodeWalkerInterface }); } - /** - * @param NodeInterface $root - * @param string $path - * @param callable $fn - * @return NodeInterface - */ public function walkPath(NodeInterface $root, $path, callable $fn) { $parts = $this->splitPath($path); diff --git a/src/Node/Walker/NodeWalkerInterface.php b/src/Node/Walker/NodeWalkerInterface.php index 9f86e07..b4c3661 100644 --- a/src/Node/Walker/NodeWalkerInterface.php +++ b/src/Node/Walker/NodeWalkerInterface.php @@ -19,4 +19,12 @@ interface NodeWalkerInterface * @return NodeInterface */ public function findNode(NodeInterface $root, $path); + + /** + * @param NodeInterface $root + * @param string $path + * @param callable $fn + * @return NodeInterface + */ + public function walkPath(NodeInterface $root, $path, callable $fn); } diff --git a/src/Stream/AbstractHandle.php b/src/Stream/AbstractHandle.php index f1368e8..fb6cdca 100644 --- a/src/Stream/AbstractHandle.php +++ b/src/Stream/AbstractHandle.php @@ -36,19 +36,11 @@ abstract class AbstractHandle implements HandleInterface list($this->scheme, $this->path) = $this->parseUrl($url); } - /** - * @return NodeInterface - */ public function getNode() { return $this->node; } - /** - * @param string $origin - * @param string $target - * @return NodeInterface - */ public function rename($target) { $this->node = $this->findNode($this->path); diff --git a/src/Stream/DirectoryHandle.php b/src/Stream/DirectoryHandle.php index 1ccbd3b..f91c939 100644 --- a/src/Stream/DirectoryHandle.php +++ b/src/Stream/DirectoryHandle.php @@ -14,19 +14,11 @@ use Vfs\Exception\UnopenedHandleException; class DirectoryHandle extends AbstractHandle { - /** - * @return boolean - */ public function canRead() { return true; } - /** - * @param integer $perms - * @param boolean $recursive - * @return NodeInterface - */ public function create($perms, $recursive = false) { $this->node = $this->findNode(); @@ -55,9 +47,6 @@ class DirectoryHandle extends AbstractHandle return $this->node; } - /** - * @return boolean - */ public function destroy() { $this->node = $this->findNode(); @@ -78,18 +67,11 @@ class DirectoryHandle extends AbstractHandle return true; } - /** - * @return NodeInterface - */ public function open() { return $this->node = $this->findNode(); } - /** - * @param integer $offset - * @return string - */ public function read($offset = 0) { if (!$this->node) { @@ -104,10 +86,6 @@ class DirectoryHandle extends AbstractHandle } } - /** - * @param string $content - * @return boolean - */ public function write($content) { return false; diff --git a/src/Stream/FileHandle.php b/src/Stream/FileHandle.php index 1858158..dbe3919 100644 --- a/src/Stream/FileHandle.php +++ b/src/Stream/FileHandle.php @@ -16,26 +16,16 @@ use Vfs\Node\NodeContainerInterface; class FileHandle extends AbstractHandle { - /** - * @return boolean - */ public function canRead() { return self::MODE_READ === $this->mode || self::MOD_EXTENDED === $this->modifier; } - /** - * @param integer $perms - * @return NodeInterface - */ public function create($perms) { return $this->node = $this->findOrBuildNode(); } - /** - * @return boolean - */ public function destroy() { $this->node = $this->findNode(); @@ -56,9 +46,6 @@ class FileHandle extends AbstractHandle return true; } - /** - * @return NodeInterface - */ public function open() { $this->node = $this->findOrBuildNode(); @@ -70,11 +57,6 @@ class FileHandle extends AbstractHandle return $this->node; } - /** - * @param integer $offset - * @param integer $length - * @return string - */ public function read($offset = 0, $length = null) { if (!$this->node) { @@ -90,11 +72,6 @@ class FileHandle extends AbstractHandle return substr($this->node->getContent(), $offset); } - /** - * @param DateTime $mtime - * @param DateTime $atime - * @return NodeInterface - */ public function touch(DateTime $mtime = null, DateTime $atime = null) { $node = $this->findOrBuildNode(); @@ -112,10 +89,6 @@ class FileHandle extends AbstractHandle return $node; } - /** - * @param string $content - * @return boolean - */ public function write($content) { if (!$this->node) {