Skip to content

Commit

Permalink
Mute E_DEPRECATED warnings during tests and add depreciation warnings…
Browse files Browse the repository at this point in the history
… to TableSchema
  • Loading branch information
Michael Hoffmann committed Sep 11, 2017
1 parent d4eadb8 commit 7228157
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<php>
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>
<ini name="error_reporting" value="E_ALL ~ &amp;E_USER_DEPRECATED"/>
</php>

<testsuites>
Expand Down
10 changes: 10 additions & 0 deletions src/Database/Schema/TableSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ public function columns()
*/
public function column($name)
{
deprecationWarning('TableSchema::column() is deprecated. Use TableSchema::getColumn() instead.');

return $this->getColumn($name);
}

Expand Down Expand Up @@ -379,6 +381,8 @@ public function getColumn($name)
*/
public function columnType($name, $type = null)
{
deprecationWarning('TableSchema::columnType() is deprecated. Use TableSchema::setColumnType() or TableSchema::getColumnType() instead.');

if ($type !== null) {
$this->setColumnType($name, $type);
}
Expand Down Expand Up @@ -536,6 +540,8 @@ public function indexes()
*/
public function index($name)
{
deprecationWarning('TableSchema::index() is deprecated. Use TableSchema::getIndex() instead.');

return $this->getIndex($name);
}

Expand Down Expand Up @@ -689,6 +695,8 @@ public function constraints()
*/
public function constraint($name)
{
deprecationWarning('TableSchema::constraint() is deprecated. Use TableSchema::getConstraint() instead.');

return $this->getConstraint($name);
}

Expand Down Expand Up @@ -734,6 +742,8 @@ public function getOptions()
*/
public function options($options = null)
{
deprecationWarning('TableSchema::options() is deprecated. Use TableSchema::setOptions() or TableSchema::getOptions() instead.');

if ($options !== null) {
return $this->setOptions($options);
}
Expand Down

0 comments on commit 7228157

Please sign in to comment.