Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
- Frontend form field conditions. [#4949](https://github.com/statamic/cms/issues/4949) by @jesseleite
- Antlers wrapper for Blade. [#5058](https://github.com/statamic/cms/issues/5058) by @jesseleite
- Support Blade section yields in Antlers layouts. [#5056](https://github.com/statamic/cms/issues/5056) by @jasonvarga
- Added wrapper classes to make working with values in Blade easier. [#5201](https://github.com/statamic/cms/issues/5201) by @jasonvarga
- Added `Statamic::query()` aliases. [#5285](https://github.com/statamic/cms/issues/5285) by @jasonvarga
- Augmentables (Entry, Term, etc) can retrieve their augmented values via property access. [#5297](https://github.com/statamic/cms/issues/5297) by @jasonvarga
- Augmentables can retrieve their augmented values via array access. [#5327](https://github.com/statamic/cms/issues/5327) by @jasonvarga
Expand All @@ -21,7 +20,7 @@
- PHP 7.2 and 7.3 are no longer supported.
- Laravel 6 and 7 are no longer supported.
- Entries fieldtypes augment to query builders instead of collections. [#5238](https://github.com/statamic/cms/issues/5238) by @jasonvarga
- The `page` and each Global Set in the cascade are now `Values` instances. [#5201](https://github.com/statamic/cms/issues/5201) by @jasonvarga
- The `page` and each global in the cascade are now instances of the page/global. [#5334](https://github.com/statamic/cms/issues/5334) by @jasonvarga
- The `Augmented` interface's `get` method now has a return typehint of `Value`. [#5302](https://github.com/statamic/cms/issues/5302) by @jasonvarga
- `$item->augmentedValue()`, `toAugmentedCollection()`, and `toAugmentedArray()` will always return `Value` instances. [#5302](https://github.com/statamic/cms/issues/5302) by @jasonvarga
- Form submission data will always be an unfiltered Collection. [#5230](https://github.com/statamic/cms/issues/5230) by @jasonvarga
Expand Down
129 changes: 0 additions & 129 deletions src/Fields/Values.php

This file was deleted.

48 changes: 0 additions & 48 deletions src/Fields/ValuesCollection.php

This file was deleted.

32 changes: 0 additions & 32 deletions src/Fields/ValuesQueryBuilder.php

This file was deleted.

55 changes: 1 addition & 54 deletions src/Tags/FluentTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
namespace Statamic\Tags;

use ArrayIterator;
use Illuminate\Support\Collection;
use Statamic\Contracts\Data\Augmentable;
use Statamic\Fields\Values;
use Statamic\Support\Str;
use Statamic\View\Antlers\Parser;
use Traversable;
Expand All @@ -32,16 +29,6 @@ class FluentTag implements \IteratorAggregate, \ArrayAccess
*/
private $loader;

/**
* @var bool
*/
protected $augmentation = true;

/**
* @var bool
*/
protected $conversion = true;

/**
* @var mixed
*/
Expand Down Expand Up @@ -96,30 +83,6 @@ public function context($context)
return $this;
}

/**
* Disable augmentation in tag output.
*
* @return $this
*/
public function withoutAugmentation()
{
$this->augmentation = false;

return $this;
}

/**
* Disable conversion into Values objects or augmenting.
*
* @return $this
*/
public function withoutConvertingValues()
{
$this->conversion = false;

return $this;
}

/**
* Fetch result of a tag.
*
Expand Down Expand Up @@ -150,23 +113,7 @@ public function fetch()
'tag_method' => $originalMethod,
]);

$output = $tag->$method();

if ($this->conversion) {
if ($this->augmentation && $output instanceof Collection) {
$output = collect($output->toAugmentedCollection())->mapInto(Values::class);
}

if ($this->augmentation && $output instanceof Augmentable) {
$output = new Values($output->toAugmentedCollection());
}

if (is_array($output)) {
$output = new Values($output);
}
}

return $this->fetched = $output;
return $this->fetched = $tag->$method();
}

/**
Expand Down
13 changes: 6 additions & 7 deletions src/View/Cascade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Statamic\Facades\GlobalSet;
use Statamic\Facades\URL;
use Statamic\Facades\User;
use Statamic\Fields\Values;
use Statamic\Sites\Site;
use Statamic\Support\Arr;

Expand Down Expand Up @@ -145,13 +144,13 @@ private function hydrateGlobals()

$global = $global->in($this->site->handle());

$this->set($global->handle(), new Values($global->toAugmentedCollection()));
$this->set($global->handle(), $global);
}

$mainGlobal = $this->get('global') ?? [];

foreach ($mainGlobal as $key => $value) {
$this->set($key, $value);
if ($mainGlobal = $this->get('global')) {
foreach ($mainGlobal->toAugmentedCollection() as $key => $value) {
$this->set($key, $value);
}
}

return $this;
Expand All @@ -171,7 +170,7 @@ private function hydrateContent()
$this->set($key, $value);
}

$this->set('page', new Values($variables));
$this->set('page', $this->content);

return $this;
}
Expand Down
33 changes: 0 additions & 33 deletions tests/Fields/ValuesCollectionTest.php

This file was deleted.

Loading