Skip to content
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

OutputPath is not really optional #27

Merged
merged 4 commits into from
Apr 3, 2018
Merged

OutputPath is not really optional #27

merged 4 commits into from
Apr 3, 2018

Conversation

kiproping
Copy link
Collaborator

@kiproping kiproping commented Apr 1, 2018

Issue

Sometimes you may want to generate images in memory, without the images being saved to an output file. Whenever you don't supply an $outputPath it errors saying Undefined property: DarrynTen\Pslayers\Config\Config::$outputPath , even though this option is optional. This is because it checks the property without fist checking if it is null.

How I fixed it

I first checked if the $outputpath is set, then check if it is null. I also added tests that were failing before, but now pass as a result of this change.

@darrynten

@kiproping kiproping requested a review from darrynten April 1, 2018 10:55
@codecov
Copy link

codecov bot commented Apr 1, 2018

Codecov Report

Merging #27 into dev will increase coverage by 0.89%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev      #27      +/-   ##
============================================
+ Coverage     85.73%   86.63%   +0.89%     
- Complexity      201      202       +1     
============================================
  Files            24       24              
  Lines           561      561              
============================================
+ Hits            481      486       +5     
+ Misses           80       75       -5
Impacted Files Coverage Δ Complexity Δ
src/Pslayers.php 92.85% <100%> (+35.71%) 6 <0> (+1) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6c73875...120ecfb. Read the comment docs.


$instance->addLayer($backgroundLayer, 0);
$instance->addLayer($gradientLayer, 1);
$instance->render();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some assertions after this to ensure what we get is what we want?

Ensure the filetype, the size etc is correct.

Copy link
Owner

@darrynten darrynten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@darrynten darrynten merged commit 65aeba0 into dev Apr 3, 2018
@darrynten darrynten deleted the fix/nullcheckerror branch April 3, 2018 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants