Skip to content

Commit

Permalink
Small fixes (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark authored Aug 29, 2024
1 parent d5ddd39 commit fb1100a
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 31 deletions.
12 changes: 6 additions & 6 deletions src/BaseListView.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ abstract class BaseListView extends Widget
final public const DEFAULT_TRANSLATION_CATEGORY = 'yii-dataview';

/**
* @var TranslatorInterface A translator instance used for translations of messages. If it was not set
* @var TranslatorInterface A translator instance used for translations of messages. If it wasn't set
* explicitly in the constructor, a default one created automatically in {@see createDefaultTranslator()}.
*/
protected readonly TranslatorInterface $translator;
Expand Down Expand Up @@ -138,7 +138,7 @@ final public function pageNotFoundExceptionCallback(?callable $callback): static
}

/**
* Return a new instance with name of argument or query parameter for page.
* Return a new instance with the name of argument or query parameter for page.
*
* @param string $name The name of argument or query parameter for page.
*/
Expand All @@ -157,7 +157,7 @@ final public function previousPageParameterName(string $name): static
}

/**
* Return a new instance with name of argument or query parameter for page size.
* Return a new instance with the name of argument or query parameter for page size.
*
* @param string $name The name of argument or query parameter for page size.
*/
Expand Down Expand Up @@ -217,7 +217,7 @@ final public function containerAttributes(array $attributes): static
/**
* Return a new instance with the empty text.
*
* @param ?string $emptyText The HTML content to be displayed when {@see dataProvider} does not have any data.
* @param ?string $emptyText The HTML content to be displayed when {@see dataProvider} doesn't have any data.
*
* The default value is the text "No results found." which will be translated to the current application language.
*
Expand Down Expand Up @@ -493,7 +493,7 @@ final public function summaryTag(?string $tag): static
/**
* Returns a new instance with the summary template.
*
* @param string|null $template The HTML content to be displayed as the summary. If you do not want to show
* @param string|null $template The HTML content to be displayed as the summary. If you don't want to show
* the summary, you may set it with an empty string or null.
*
* The following tokens will be replaced with the corresponding values:
Expand Down Expand Up @@ -718,7 +718,7 @@ private function renderHeader(): string
}

/**
* Creates default translator to use if {@see $translator} was not set explicitly in the constructor. Depending on
* Creates default translator to use if {@see $translator} wasn't set explicitly in the constructor. Depending on
* "intl" extension availability, either {@see IntlMessageFormatter} or {@see SimpleMessageFormatter} is used as
* formatter.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Column/Base/Cell.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(

/**
* @param bool|null $encode Whether to encode tag content. Supported values:
* - `null`: stringable objects that implement interface {@see NoEncodeStringableInterface} are not encoded,
* - `null`: stringable objects that implement interface {@see NoEncodeStringableInterface} aren't encoded,
* everything else is encoded;
* - `true`: any content is encoded;
* - `false`: nothing is encoded.
Expand Down
2 changes: 1 addition & 1 deletion src/Column/DataColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* By setting {@see value} and {@see label}, the label and cell content can be customized.
*
* A data column differentiates between the {@see getDataCellValue|data cell value} and the
* {@see renderDataCellContent|data cell content}. The cell value is an un-formatted value that may be used for
* {@see renderDataCellContent|data cell content}. The cell value is an unformatted value that may be used for
* calculation, while the actual cell content is a {@see format|formatted} version of that value which may contain HTML
* markup.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Column/DataColumnRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function makeFilter(ColumnInterface $column, MakeFilterContext $context):
public function renderBody(ColumnInterface $column, Cell $cell, DataContext $context): Cell
{
$this->checkColumn($column);
/** @var DataColumn $column This annotation need for IDE only */
/** @var DataColumn $column This annotation is for IDE only */

$contentSource = $column->content;

Expand Down
14 changes: 7 additions & 7 deletions src/DetailView.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
use Yiisoft\Yii\DataView\Field\DataField;

/**
* DetailView displays the detail of a single data.
* DetailView displays the detail of single data.
*
* DetailView is best used for displaying a data in a regular format (e.g. each field is displayed using flexbox).
* DetailView is displaying data in a regular format (each field is displayed using flexbox).
*
* The data can be either object or an associative array.
* The data can be either an object or an associative array.
*
* DetailView uses the {@see data} property to determines which model should be displayed how they should be formatted.
* DetailView uses the {@see data} property to determine which model should be displayed how they should be formatted.
*
* A typical usage of DetailView is as follows:
*
Expand Down Expand Up @@ -53,7 +53,7 @@ final class DetailView extends Widget
private string $valueTrue = 'true';

/**
* Returns a new instance with the HTML attributes. The following special options are recognized.
* Returns a new instance with the HTML attributes.
*
* @param array $values Attribute values indexed by attribute names.
*/
Expand Down Expand Up @@ -81,8 +81,8 @@ public function containerAttributes(array $values): self
/**
* Return new instance with the data.
*
* @param array|object $data the data model whose details are to be displayed. This can be an instance, an
* associative array, an object.
* @param array|object $data the data model whose details are to be displayed.
* This can be an instance, an associative array, an object.
*/
public function data(array|object $data): self
{
Expand Down
2 changes: 1 addition & 1 deletion src/Filter/Widget/DropdownFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class DropdownFilter extends FilterWidget
* @param array $data Options data. The array keys are option values, and the array values are the corresponding
* option labels.
*
* @param bool $encode Whether option content should be HTML-encoded.
* @param bool $encode Whether to HTML-encode option content.
* @param array[] $optionsAttributes Array of option attribute sets indexed by option values from {@see $data}.
* @param array[] $groupsAttributes Array of group attribute sets indexed by group labels from {@see $data}.
*
Expand Down
10 changes: 5 additions & 5 deletions src/GridView.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
use Yiisoft\Yii\DataView\Filter\Factory\IncorrectValueException;

/**
* The GridView widget is used to display data in a grid.
* The GridView widget displays data in a grid.
*
* The columns of the grid table are configured in terms of {@see Column} classes, which are configured via
* You can configure the columns of the grid table in terms of {@see Column} classes configured via
* {@see columns}.
*
* The look and feel of a grid view can be customized using the large amount of properties.
* The look and feel of a grid view can be customized using many properties.
*
* @psalm-import-type UrlCreator from BaseListView
*/
Expand Down Expand Up @@ -208,7 +208,7 @@ public function columnGroupEnabled(bool $value = true): self
* Return new instance with the HTML display when the content is empty.
*
* @param string $value The HTML display when the content of a cell is empty. This property is used to render cells
* that have no defined content, e.g. empty footer.
* that have no defined content, e.g., empty footer.
*/
public function emptyCell(string $value): self
{
Expand Down Expand Up @@ -382,7 +382,7 @@ public function bodyCellAttributes(array $attributes): self
}

/**
* Return new instance with the HTML attributes for link in sortable columns' headers.
* Return new instance with the HTML attributes for a link in sortable columns' headers.
*
* @param array $attributes The tag attributes in terms of name-value pairs.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/ListView.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Yiisoft\View\View;

/**
* The ListView widget is used to display data from data provider. Each data model is rendered using the view specified.
* The ListView widget displays data from data provider. Each data model is rendered using the view specified.
*/
final class ListView extends BaseListView
{
Expand All @@ -31,7 +31,7 @@ final class ListView extends BaseListView
/**
* Return new instance with afterItem closure.
*
* @param Closure $value an anonymous function that is called once after rendering each data.
* @param Closure $value An anonymous function that is called once after rendering each data.
*
* It should have the same signature as {@see beforeItem}.
*
Expand Down Expand Up @@ -154,7 +154,7 @@ public function viewParams(array $viewParams): self
* @param mixed $key The key value associated with the data.
* @param int $index The zero-based index of the data array.
*
* @throws ViewNotFoundException If the item view file does not exist.
* @throws ViewNotFoundException If the item view file doesn't exist.
*/
protected function renderItem(array|object $data, mixed $key, int $index): string
{
Expand Down Expand Up @@ -193,7 +193,7 @@ protected function renderItem(array|object $data, mixed $key, int $index): strin
/**
* Renders all data models.
*
* @throws ViewNotFoundException If the item view file does not exist.
* @throws ViewNotFoundException If the item view file doesn't exist.
*/
protected function renderItems(array $items, \Yiisoft\Validator\Result $filterValidationResult): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/OffsetPagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function labelLast(string|Stringable|null $label): self
}

/**
* Return a new instance with max nav link count.
* Return a new instance with a max nav link count.
*
* @param int $value Max nav link count.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/YiiRouter/ActionColumnUrlCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __invoke(string $action, DataContext $context): string
? $context->data->$primaryKey
: $context->data[$primaryKey];

/** @psalm-suppress PossiblyNullOperand We guess that current route is matched. */
/** @psalm-suppress PossiblyNullOperand Assume that the current route matches. */
$route = ($config->baseRouteName ?? $this->currentRoute->getName()) . '/' . $action;

$arguments = $config->arguments;
Expand Down
2 changes: 1 addition & 1 deletion tests/DetailView/ImmutableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class ImmutableTest extends TestCase
* @throws NotInstantiableException
* @throws CircularReferenceException
*/
public function testInmutable(): void
public function testImmutable(): void
{
$detailView = DetailView::widget();
$this->assertNotSame($detailView, $detailView->attributes([]));
Expand Down
2 changes: 1 addition & 1 deletion tests/ListView/ImmutableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class ImmutableTest extends TestCase
* @throws NotInstantiableException
* @throws CircularReferenceException
*/
public function testInmutable(): void
public function testImmutable(): void
{
$listView = ListView::widget();
$this->assertNotSame($listView, $listView->afterItem(fn () => ''));
Expand Down
2 changes: 1 addition & 1 deletion tests/Support/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
final class Assert extends TestCase
{
/**
* Asserting two strings equality ignoring line endings.
* Asserting two strings are equal ignoring line endings.
*
* @param string $expected The expected string.
* @param string $actual The actual string.
Expand Down

0 comments on commit fb1100a

Please sign in to comment.