Skip to content

Commit

Permalink
Issue #13: Add ColumnAttributesInterface, and let TableInterface exte…
Browse files Browse the repository at this point in the history
…nd it.
  • Loading branch information
donquixote committed Oct 31, 2024
1 parent 8ce5b72 commit e3e2141
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 7 deletions.
16 changes: 16 additions & 0 deletions src/Columns/ColumnAttributes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Donquixote\Cellbrush\Columns;

/**
* This class is not used anywhere.
*
* It only exists to prove that ColumnAttributesTrait is complete.
*
* @internal
*/
class ColumnAttributes implements ColumnAttributesInterface {

use ColumnAttributesTrait;

}
16 changes: 16 additions & 0 deletions src/Columns/ColumnAttributesInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Donquixote\Cellbrush\Columns;

interface ColumnAttributesInterface {

/**
* @param string $colName
* @param string $name
* @param string $value
*
* @return $this
*/
public function setColAttribute($colName, $name, $value);

}
9 changes: 4 additions & 5 deletions src/Columns/ColumnAttributesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace Donquixote\Cellbrush\Columns;

/**
* @see ColumnAttributesInterface
*/
trait ColumnAttributesTrait {

use ColumnClassesTrait;
Expand All @@ -11,11 +14,7 @@ function __constructColumnAttributes() {
}

/**
* @param string $colName
* @param string $name
* @param string $value
*
* @return $this
* {@inheritdoc}
*/
public function setColAttribute($colName, $name, $value) {
$this->colAttributes->nameSetAttribute($colName, $name, $value);
Expand Down
4 changes: 2 additions & 2 deletions src/Table/TableInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Donquixote\Cellbrush\Table;

use Donquixote\Cellbrush\Columns\ColumnClassesInterface;
use Donquixote\Cellbrush\Columns\ColumnAttributesInterface;
use Donquixote\Cellbrush\Columns\TableColumnsInterface;
use Donquixote\Cellbrush\Html\MutableAttributesInterface;
use Donquixote\Cellbrush\TSection\TableSectionStructureInterface;
Expand All @@ -11,6 +11,6 @@ interface TableInterface extends
MutableAttributesInterface,
TableSectionStructureInterface,
TableColumnsInterface,
ColumnClassesInterface {
ColumnAttributesInterface {

}

0 comments on commit e3e2141

Please sign in to comment.