-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: crynobone <crynobone@gmail.com>
- Loading branch information
Showing
4 changed files
with
71 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,9 @@ | ||
<?php namespace Orchestra\Memory; | ||
|
||
use Orchestra\Contracts\Memory\Provider as ProviderContract; | ||
|
||
/** | ||
* @deprecated v3.2.x | ||
*/ | ||
trait ContainerTrait | ||
{ | ||
/** | ||
* Memory instance. | ||
* | ||
* @var \Orchestra\Contracts\Memory\Provider | ||
*/ | ||
protected $memory = null; | ||
|
||
/** | ||
* Check whether a Memory instance is already attached to the container. | ||
* | ||
* @return bool | ||
*/ | ||
public function attached() | ||
{ | ||
return ($this->memory instanceof ProviderContract); | ||
} | ||
|
||
/** | ||
* Attach memory provider. | ||
* | ||
* @param \Orchestra\Contracts\Memory\Provider $memory | ||
* | ||
* @return object | ||
*/ | ||
public function attach(ProviderContract $memory) | ||
{ | ||
$this->setMemoryProvider($memory); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Set memory provider. | ||
* | ||
* @param \Orchestra\Contracts\Memory\Provider $memory | ||
* | ||
* @return object | ||
*/ | ||
public function setMemoryProvider(ProviderContract $memory) | ||
{ | ||
$this->memory = $memory; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Set memory provider. | ||
* | ||
* @return \Orchestra\Contracts\Memory\Provider|null | ||
*/ | ||
public function getMemoryProvider() | ||
{ | ||
return $this->memory; | ||
} | ||
use Memorizable; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php namespace Orchestra\Memory; | ||
|
||
use Orchestra\Contracts\Memory\Provider as ProviderContract; | ||
|
||
trait Memorizable | ||
{ | ||
/** | ||
* Memory instance. | ||
* | ||
* @var \Orchestra\Contracts\Memory\Provider | ||
*/ | ||
protected $memory = null; | ||
|
||
/** | ||
* Check whether a Memory instance is already attached to the container. | ||
* | ||
* @return bool | ||
*/ | ||
public function attached() | ||
{ | ||
return ($this->memory instanceof ProviderContract); | ||
} | ||
|
||
/** | ||
* Attach memory provider. | ||
* | ||
* @param \Orchestra\Contracts\Memory\Provider $memory | ||
* | ||
* @return object | ||
*/ | ||
public function attach(ProviderContract $memory) | ||
{ | ||
$this->setMemoryProvider($memory); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Set memory provider. | ||
* | ||
* @param \Orchestra\Contracts\Memory\Provider $memory | ||
* | ||
* @return object | ||
*/ | ||
public function setMemoryProvider(ProviderContract $memory) | ||
{ | ||
$this->memory = $memory; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Set memory provider. | ||
* | ||
* @return \Orchestra\Contracts\Memory\Provider|null | ||
*/ | ||
public function getMemoryProvider() | ||
{ | ||
return $this->memory; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters