2

I have the next classes in PHP:

class CWebApplication extends CApplication {

//...

public function processRequest(){
    //...
}

and

abstract class CApplication extends CModule {

    abstract public function processRequest();
    //...

But it reports the follow error:

Fatal error: Class CWebApplication contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (CApplication::processRequest) in /Users/nram/Sites/ryl/framework/web/CWebApplication.php on line 10
12
  • 2
    Not sure... what you are trying to do definately works in php as expected. There must be something in your setup... Maybe the file where class CApplication is defined is a) not saved or b) exists in different versions? Maybe the implementation of ` CWebApplication::processRequest is not visible, maybe hidden by a conditional or a syntax error? What if you put a syntax error in there? Commented Jan 26, 2013 at 16:05
  • @KevinBrydon why should that matter? Commented Jan 26, 2013 at 16:06
  • @arkascha It may be that the answer is in there. Could it be that there is an additional processRequest method in CModule with different arguments? Who knows. NRAMs first step should probably be commenting out the abstract processRequest method to confirm that the error is still produced. Commented Jan 26, 2013 at 16:11
  • If a second version of ProcessRequest was defined in CModule then the error message would refer to that function... But you are right, it is certainly worth keeping that class in mind as well. Commented Jan 26, 2013 at 16:13
  • 2
    Aha! That means your method CWebApplication::processResult is not interpreted! So ask yourself: why not? Most likely it is hidden somehow... Maybe the class definition is closed beofre? Often happens when the indentation levels are borked... Commented Jan 26, 2013 at 16:22

1 Answer 1

1

I saw your code.

In that,

RYL-master\framework\web\CWebApplication.php

actually extends,

RYL-master\framework\base\CApplication.php

In that there it starts with,

<?php

/**
 * CWebApplication class file.
 *
 * @author Nuno Morais <[email protected]>
 *
 */

abstract class CApplication extends CModule {

    private $_basePath;


    abstract public function processRequest();

::So you should extend or declare function processRequest(); in CWebApplication.php.

Hope this helps! :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.