Skip to content

Commit

Permalink
Updated dependencies. Cleaned up interfaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
dalabarge committed Jul 9, 2014
1 parent eb1455f commit e744af0
Show file tree
Hide file tree
Showing 28 changed files with 38 additions and 205 deletions.
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,19 @@
"license": "MIT",
"require": {
"php": ">=5.4.0",
"illuminate/database": "4.2.*",
"illuminate/encryption": "4.2.*",
"illuminate/events": "4.2.*",
"illuminate/hashing": "4.2.*",
"illuminate/support": "4.2.*",
"illuminate/validation": "4.2.*",
"watson/validating": "0.8.*"
"illuminate/database": "~4.2.6",
"illuminate/encryption": "~4.2.6",
"illuminate/events": "~4.2.6",
"illuminate/hashing": "~4.2.6",
"illuminate/support": "~4.2.6",
"illuminate/validation": "~4.2.6",
"watson/validating": "0.9.*"
},
"require-dev": {
"phpunit/phpunit": "4.1.*",
"mockery/mockery": "0.9.*"
},
"autoload": {
"files": ["src/helpers.php"],
"psr-4": {
"Esensi\\Model\\": "src/"
}
Expand Down
10 changes: 1 addition & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,6 @@ class Post extends Eloquent implements ValidatingModelInterface {

use ValidatingModelTrait;

/**
* This tells whether or not the model should inject its identifier
* into the unique validation rules before attempting validation.
*
* @var boolean
*/
protected $injectUniqueIdentifier = true;

/**
* These are the default rules that the model will validate against.
* Developers will probably want to specify generic validation rules
Expand Down Expand Up @@ -635,7 +627,7 @@ phpunit ./tests

[Emerson Media](http://www.emersonmedia.com) is proud to work with some of the most talented developers in the PHP community. The developer team welcomes requests, suggestions, issues, and of course pull requests. When submitting issues please be as detailed as possible and provide code examples where possible. When submitting pull requests please follow the same code formatting and style guides that the Esensi code base uses. Please help the open-source community out by including good code test coverage with your pull requests. **All pull requests _must_ be submitted to the version branch to which the code changes apply.**

> **Note:** The development team does its best to address all issues on Wednesdays. Pull requests are reviewed in priority followed by urgent bug fixes. Each week the package dependencies are re-evaluated and updates are made for new tag releases.
> **Note:** The Esensi team does its best to address all issues on Wednesdays. Pull requests are reviewed in priority followed by urgent bug fixes. Each week the package dependencies are re-evaluated and updates are made for new tag releases.
## Licensing

Expand Down
36 changes: 1 addition & 35 deletions src/Contracts/EncryptingModelInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,13 @@
* Encrypting Model Interface
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
*/
interface EncryptingModelInterface {

/**
* Get an encrypted attribute dynamically.
*
* @param string $attribute
* @return mixed
*/
function getDynamicEncrypted( $attribute );

/**
* Set an encryptable attribute dynamically.
*
* @param string $attribute
* @param mixed $value
* @return boolean
*/
function setDynamicEncryptable( $attribute, $value );

/**
* Get the encryptable attributes.
*
Expand Down Expand Up @@ -150,21 +133,4 @@ public function encrypt( $value );
*/
public function decrypt( $value );

/**
* Get the decrypted value for an encrypted attribute.
*
* @param string $attribute name
* @return string
*/
function getEncryptedAttribute( $attribute );

/**
* Set an encrypted value for an encryptable attribute.
*
* @param string $attribute name
* @param string $value to encrypt
* @return void
*/
function setEncryptingAttribute( $attribute, $value);

}
19 changes: 1 addition & 18 deletions src/Contracts/HashingModelInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Hashing Model Interface
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
Expand Down Expand Up @@ -126,15 +126,6 @@ public function hash( $value );
*/
public function checkHash( $value, $hash );

/**
* Set a hashed value for a hashable attribute.
*
* @param string $attribute name
* @param string $value to hash
* @return void
*/
function setHashingAttribute( $attribute, $value );

/**
* Save with hashing even if hashing is disabled.
*
Expand All @@ -149,12 +140,4 @@ public function saveWithHashing();
*/
public function saveWithoutHashing();

/**
* Set hashing state and then save and then reset it.
*
* @param boolean $hash
* @return boolean
*/
function setHashingAndSave( $hash );

}
10 changes: 1 addition & 9 deletions src/Contracts/PurgingModelInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Purging Model Interface
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
Expand Down Expand Up @@ -98,12 +98,4 @@ public function saveWithPurging();
*/
public function saveWithoutPurging();

/**
* Set purging state and then save and then reset it.
*
* @param boolean $purge
* @return boolean
*/
function setPurgingAndSave( $purge );

}
27 changes: 1 addition & 26 deletions src/Contracts/RelatingModelInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,13 @@
* Relating Model Interface
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
*/
interface RelatingModelInterface {

/**
* Call a dynamically resolved relationship.
*
* @param string $name
* @return mixed
*/
function callDynamicRelationship( $name );

/**
* Get a dynamically resolved relationship.
*
* @param string $name
* @return mixed
*/
function getDynamicRelationship( $name );

/**
* Return the relationship configurations.
*
Expand All @@ -44,13 +28,4 @@ public function getRelationship( $name );
*/
public function isRelationship( $name );

/**
* Proxy call a relationship method using the
* configuration arguments of the relationship.
*
* @param string $name of related model
* @return mixed
*/
function callRelationship( $name );

}
2 changes: 1 addition & 1 deletion src/Contracts/SoftDeletingModelInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Soft Deleting Model Interface
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/ValidatingModelInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Validating Model Interface
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
Expand Down
48 changes: 6 additions & 42 deletions src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Base Model
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
Expand Down Expand Up @@ -96,11 +96,12 @@ abstract class Model extends Eloquent implements
protected $rulesets = [];

/**
* The attributes to purge before saving.
* The attributes to encrypt when set and
* decrypt when gotten.
*
* @var array
*/
protected $purgeable = [];
protected $encryptable = [];

/**
* The attributes to hash before saving.
Expand All @@ -110,12 +111,11 @@ abstract class Model extends Eloquent implements
protected $hashable = [];

/**
* The attributes to encrypt when set and
* decrypt when gotten.
* The attributes to purge before saving.
*
* @var array
*/
protected $encryptable = [];
protected $purgeable = [];

/**
* Relationships that the model should set up.
Expand All @@ -124,21 +124,6 @@ abstract class Model extends Eloquent implements
*/
protected $relationships = [];

/**
* Whether the model should inject it's identifier to the unique
* validation rules before attempting validation.
*
* @var boolean
*/
protected $injectUniqueIdentifier = true;

/**
* Whether the model should throw ValidatingException when
* the model fails validation.
*
* @var boolean
*/
protected $throwValidationExceptions = false;

/**
* Dynamically retrieve attributes.
Expand All @@ -164,25 +149,4 @@ public function __get( $key )
return parent::__get( $key );
}

/**
* Boot all of the bootable traits on the model.
*
* We overwrite the parent method because Laravel does not
* yet support booting inherited traits.
*
* @todo remove this when Laravel supports this recursion
* @return void
*/
protected static function bootTraits()
{
$traits = function_exists('class_uses_recursive') ? class_uses_recursive(get_called_class()) : class_uses(get_called_class());
foreach ($traits as $trait)
{
if (method_exists(get_called_class(), $method = 'boot'.class_basename($trait)))
{
forward_static_call([get_called_class(), $method]);
}
}
}

}
2 changes: 1 addition & 1 deletion src/Observers/HashingModelObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Model observer for Hashing Model Trait
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
Expand Down
2 changes: 1 addition & 1 deletion src/Observers/PurgingModelObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Model observer for Purging Model Trait
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
Expand Down
2 changes: 1 addition & 1 deletion src/Observers/ValidatingModelObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Model observer for Validating Model Trait
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
Expand Down
2 changes: 1 addition & 1 deletion src/SoftModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Soft Deleting Model
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/EncryptingModelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Trait that implements the Encrypting Model Interface
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/HashingModelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Trait that implements the Hashing Model Interface
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/PurgingModelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Trait that implements the Purging Model Interface
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/RelatingModelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Trait that implements the Relating Model Interface
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/SoftDeletingModelTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Trait that implements the Soft Deleting Model Interface
*
* @package Esensi\Model
* @author Daniel LaBarge <wishlist@emersonmedia.com>
* @author Daniel LaBarge <dalabarge@emersonmedia.com>
* @copyright 2014 Emerson Media LP
* @license https://github.com/esensi/model/blob/master/LICENSE.txt MIT License
* @link http://www.emersonmedia.com
Expand Down
Loading

0 comments on commit e744af0

Please sign in to comment.