Skip to content

Commit 63629a0

Browse files
committed
Deprecate magic accessor function. Introduce regular getters for row and column counts.
1 parent ba8e102 commit 63629a0

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/Matrix.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,19 +727,36 @@ public function offsetUnset($offset)
727727
*
728728
* @param string $property
729729
* @return int|null
730+
* @deprecated Use `getColumns` or `getRows` instead
730731
*/
731732
public function __get($property)
732733
{
733734
switch ($property) {
734735
case 'columns':
735-
return $this->columnCount;
736+
return $this->getColumnCount();
736737
case 'rows':
737-
return $this->rowCount;
738+
return $this->getRowCount();
738739
default:
739740
return null;
740741
}
741742
}
742743

744+
/**
745+
* @return int
746+
*/
747+
public function getColumnCount()
748+
{
749+
return $this->columnCount;
750+
}
751+
752+
/**
753+
* @return int
754+
*/
755+
public function getRowCount()
756+
{
757+
return $this->rowCount;
758+
}
759+
743760
/**
744761
* @return string
745762
*/

0 commit comments

Comments
 (0)