Skip to content

Commit

Permalink
Removing the FilesystemInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Jun 21, 2015
1 parent 28fcce5 commit 25af207
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 44 deletions.
34 changes: 0 additions & 34 deletions src/Contracts/FilesystemInterface.php

This file was deleted.

17 changes: 8 additions & 9 deletions src/Json.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php namespace Arcanedev\Support;

use Arcanedev\Support\Contracts\Arrayable;
use Arcanedev\Support\Contracts\FilesystemInterface;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Collection;

Expand All @@ -25,7 +24,7 @@ class Json implements Arrayable
/**
* The laravel filesystem instance.
*
* @var FilesystemInterface
* @var Filesystem
*/
protected $filesystem;

Expand All @@ -44,9 +43,9 @@ class Json implements Arrayable
* The constructor.
*
* @param mixed $path
* @param FilesystemInterface $filesystem
* @param Filesystem $filesystem
*/
public function __construct($path, FilesystemInterface $filesystem = null)
public function __construct($path, Filesystem $filesystem = null)
{
$this->path = (string) $path;
$this->filesystem = $filesystem ?: new Filesystem;
Expand All @@ -60,7 +59,7 @@ public function __construct($path, FilesystemInterface $filesystem = null)
/**
* Get filesystem.
*
* @return FilesystemInterface
* @return Filesystem
*/
public function getFilesystem()
{
Expand All @@ -70,11 +69,11 @@ public function getFilesystem()
/**
* Set filesystem.
*
* @param FilesystemInterface $filesystem
* @param Filesystem $filesystem
*
* @return self
*/
public function setFilesystem(FilesystemInterface $filesystem)
public function setFilesystem(Filesystem $filesystem)
{
$this->filesystem = $filesystem;

Expand Down Expand Up @@ -113,11 +112,11 @@ public function setPath($path)
* Make new instance.
*
* @param string $path
* @param FilesystemInterface $filesystem
* @param Filesystem $filesystem
*
* @return static
*/
public static function make($path, FilesystemInterface $filesystem = null)
public static function make($path, Filesystem $filesystem = null)
{
return new static($path, $filesystem);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function it_can_get_and_set_filesystem()
$this->json->getFilesystem()
);

$mock = 'Arcanedev\\Support\\Contracts\\FilesystemInterface';
$mock = 'Illuminate\\Filesystem\\Filesystem';
$filesystem = $this->prophesize($mock);
$this->json->setFilesystem($filesystem->reveal());

Expand Down

0 comments on commit 25af207

Please sign in to comment.