Skip to content

Commit

Permalink
feat: change_pkg_name
Browse files Browse the repository at this point in the history
  • Loading branch information
thuhtettun-geniefintech committed Jul 13, 2022
1 parent b0d1f58 commit a695a3c
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 19 deletions.
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "spatie/weight-conversion",
"name": "thuhtet/weight-conversion",
"description": "Weight Conversion in PHP",
"keywords": [
"spatie",
"thuhtet",
"laravel",
"weight-conversion"
],
"homepage": "https://github.com/spatie/weight-conversion",
"homepage": "https://github.com/thuhtet/weight-conversion",
"license": "MIT",
"authors": [
{
Expand Down Expand Up @@ -34,13 +34,13 @@
},
"autoload": {
"psr-4": {
"Spatie\\WeightConversion\\": "src",
"Spatie\\WeightConversion\\Database\\Factories\\": "database/factories"
"Thuhtet\\WeightConversion\\": "src",
"Thuhtet\\WeightConversion\\Database\\Factories\\": "database/factories"
}
},
"autoload-dev": {
"psr-4": {
"Spatie\\WeightConversion\\Tests\\": "tests"
"Thuhtet\\WeightConversion\\Tests\\": "tests"
}
},
"scripts": {
Expand All @@ -55,10 +55,10 @@
"extra": {
"laravel": {
"providers": [
"Spatie\\WeightConversion\\WeightConversionServiceProvider"
"Thuhtet\\WeightConversion\\WeightConversionServiceProvider"
],
"aliases": {
"WeightConversion": "Spatie\\WeightConversion\\Facades\\WeightConversion"
"WeightConversion": "Thuhtet\\WeightConversion\\Facades\\WeightConversion"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/WeightConversionCommand.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Spatie\WeightConversion\Commands;
namespace Thuhtet\WeightConversion\Commands;

use Illuminate\Console\Command;

Expand Down
4 changes: 2 additions & 2 deletions src/Facades/WeightConversion.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace Spatie\WeightConversion\Facades;
namespace Thuhtet\WeightConversion\Facades;

use Illuminate\Support\Facades\Facade;

/**
* @see \Spatie\WeightConversion\WeightConversion
* @see \Thuhtet\WeightConversion\WeightConversion
*/
class WeightConversion extends Facade
{
Expand Down
16 changes: 15 additions & 1 deletion src/WeightConversion.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
<?php

namespace Spatie\WeightConversion;
namespace Thuhtet\WeightConversion;

class WeightConversion
{
public static function kilogram(float $kilograms): self
{
return new static($kilograms);
}

public function __construct(protected float $kilograms)
{
# code...
}

public function toPounds(): float
{
return $this->kilograms * 2.2046;
}
}
4 changes: 2 additions & 2 deletions src/WeightConversionServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Spatie\WeightConversion;
namespace Thuhtet\WeightConversion;

use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
use Spatie\WeightConversion\Commands\WeightConversionCommand;
use Thuhtet\WeightConversion\Commands\WeightConversionCommand;

class WeightConversionServiceProvider extends PackageServiceProvider
{
Expand Down
7 changes: 5 additions & 2 deletions tests/ExampleTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

it('can test', function () {
expect(true)->toBeTrue();
use Thuhtet\WeightConversion\WeightConversion;

it('can convert kilograms to pounds', function () {
$pounds = WeightConversion::kilogram(100)->toPounds();
expect($pounds)->toEqual(220.46);
});
2 changes: 1 addition & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

use Spatie\WeightConversion\Tests\TestCase;
use Thuhtet\WeightConversion\Tests\TestCase;

uses(TestCase::class)->in(__DIR__);
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Spatie\WeightConversion\Tests;
namespace Thuhtet\WeightConversion\Tests;

use Illuminate\Database\Eloquent\Factories\Factory;
use Orchestra\Testbench\TestCase as Orchestra;
use Spatie\WeightConversion\WeightConversionServiceProvider;
use Thuhtet\WeightConversion\WeightConversionServiceProvider;

class TestCase extends Orchestra
{
Expand Down

0 comments on commit a695a3c

Please sign in to comment.