Skip to content

Laravel 10 support #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 23, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Fix styling
  • Loading branch information
ousid authored and github-actions[bot] committed Feb 23, 2023
commit 6d9da76a9611282c3d692edf536c39d01e30cea4
6 changes: 0 additions & 6 deletions src/Concerns/HasCsvProperties.php
Original file line number Diff line number Diff line change
@@ -20,8 +20,6 @@ trait HasCsvProperties

/**
* Read CSV Property
*
* @return Reader
*/
public function getReadCsvProperty(): Reader
{
@@ -30,8 +28,6 @@ public function getReadCsvProperty(): Reader

/**
* Get CSV Records Property
*
* @return TabularDataReader
*/
public function getCsvRecordsProperty(): TabularDataReader
{
@@ -40,8 +36,6 @@ public function getCsvRecordsProperty(): TabularDataReader

/**
* Handle CSV Information properties from the given file
*
* @return array|\Illuminate\Support\MessageBag
*/
public function handleCsvProperties(): array|MessageBag
{
6 changes: 0 additions & 6 deletions src/Concerns/InteractsWithColumns.php
Original file line number Diff line number Diff line change
@@ -6,8 +6,6 @@ trait InteractsWithColumns
{
/**
* Converts the columnsToMap property into an associative array.
*
* @return array
*/
protected function mapThroughColumns(): array
{
@@ -22,8 +20,6 @@ protected function mapThroughColumns(): array

/**
* Maps requiredColumns property into columnsToMap required state.
*
* @return array
*/
protected function mapThroughRequiredColumns(): array
{
@@ -39,8 +35,6 @@ protected function mapThroughRequiredColumns(): array

/**
* Maps columnLabels property into columnsToMap label state.
*
* @return array
*/
protected function mapThroughColumnLabels(): array
{
3 changes: 0 additions & 3 deletions src/Concerns/InteractsWithCsvFiles.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,6 @@ trait InteractsWithCsvFiles
{
/**
* Read CSV File.
*
* @param string $path
* @return Reader
*/
protected function readCSV(string $path): Reader
{
6 changes: 0 additions & 6 deletions src/Http/Livewire/CsvImporter.php
Original file line number Diff line number Diff line change
@@ -22,25 +22,19 @@ class CsvImporter extends Component
/** @var string */
public $model;

/** @var bool */
public bool $open = false;

/** @var object */
public $file;

/** @var array */
public array $columnsToMap = [];

/** @var array */
public array $requiredColumns = [];

/** @var array */
public array $columnLabels = [];

/** @var array */
public array $fileHeaders = [];

/** @var int */
public int $fileRowCount = 0;

/** @var array */
4 changes: 0 additions & 4 deletions src/LaravelCsvDirectives.php
Original file line number Diff line number Diff line change
@@ -20,8 +20,6 @@ public static function csvStyles(): string|null

/**
* Get CSV Scripts
*
* @return string
*/
public static function csvScripts(): string
{
@@ -32,8 +30,6 @@ public static function csvScripts(): string

/**
* Get Tailwind Style Path
*
* @return string
*/
protected static function getTailwindStyle(): string
{
4 changes: 0 additions & 4 deletions src/LaravelCsvManager.php
Original file line number Diff line number Diff line change
@@ -6,10 +6,6 @@ class LaravelCsvManager
{
/**
* Get the given size and formated it.
*
* @param int $size
* @param int $precision
* @return string|int
*/
public function formatFileSize(int $size, int $precision = 2): string|int
{
7 changes: 0 additions & 7 deletions src/LaravelCsvServiceProvider.php
Original file line number Diff line number Diff line change
@@ -43,8 +43,6 @@ public function registeringPackage()

/**
* Configure Laravel CSV Blade components
*
* @return void
*/
protected function configureComponents(): void
{
@@ -55,8 +53,6 @@ protected function configureComponents(): void

/**
* Register livewire components
*
* @return void
*/
protected function registerLivewireComponents(): void
{
@@ -69,9 +65,6 @@ protected function registerLivewireComponents(): void

/**
* Register given component.
*
* @param string $component
* @return void
*/
protected function registerComponent(string $component): void
{
12 changes: 0 additions & 12 deletions src/Scopes/ImportScope.php
Original file line number Diff line number Diff line change
@@ -9,8 +9,6 @@ trait ImportScope
{
/**
* Completed Status Scope
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeCompleted(Builder $builder): Builder
{
@@ -19,8 +17,6 @@ public function scopeCompleted(Builder $builder): Builder

/**
* Not Completed Status Scope
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeUnCompleted(Builder $builder): Builder
{
@@ -29,8 +25,6 @@ public function scopeUnCompleted(Builder $builder): Builder

/**
* Get the percentage of the model completion
*
* @return int|float
*/
public function percentageComplete(): int|float
{
@@ -39,9 +33,6 @@ public function percentageComplete(): int|float

/**
* Fetch imports based on the given model
*
* @param string $model
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeForModel(Builder $builder, string $model): Builder
{
@@ -50,9 +41,6 @@ public function scopeForModel(Builder $builder, string $model): Builder

/**
* Fetch imports on the user id
*
* @param int $user
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeForUser(Builder $builder, int $user): Builder
{
8 changes: 0 additions & 8 deletions src/Utilities/ChunkIterator.php
Original file line number Diff line number Diff line change
@@ -18,14 +18,8 @@
*/
class ChunkIterator
{
/**
* @var Iterator
*/
protected Iterator $iterator;

/**
* @var int
*/
protected int $chunkSize;

public function __construct(Iterator $iterator, int $chunkSize)
@@ -36,8 +30,6 @@ public function __construct(Iterator $iterator, int $chunkSize)

/**
* Chunk the given data
*
* @return Generator
*/
public function get(): Generator
{
3 changes: 0 additions & 3 deletions src/helpers.php
Original file line number Diff line number Diff line change
@@ -5,9 +5,6 @@
if (! function_exists('Coderflex\LaravelCsv\csv_view_path')) {
/**
* Get the evaluated view content from the livewire view
*
* @param string|null $view
* @return string
*/
function csv_view_path(string|null $view): string
{